Resolves a unit test class (or classes) from a class or namespace path string.

Parameters

  • string $test The path string in which to find the test case(s). This may be a library, a namespace, or a fully-namespaced class reference.

Returns

array Returns an array containing one or more fully-namespaced class references to unit tests.

Source

						protected function _resolve($test) {
		if (strpos($test, '\\') === false && Libraries::get($test)) {
			return (array) Libraries::find($test, array(
				'recursive' => true, 'filter' => '/cases|integration|functional/'
			));
		}
		if (preg_match("/Test/", $test)) {
			return array($test);
		}
		if (!$test = trim($test, '\\')) {
			return array();
		}
		list($library, $path) = explode('\\', $test, 2) + array($test, null);

		return (array) Libraries::find($library, array(
			'recursive' => true,
			'path' => '/' . str_replace('\\', '/', $path),
			'filter' => '/cases|integration|functional/'
		));
	}