TestDiscovery
class TestDiscovery (View source)
Discovers available tests.
Properties
| protected ClassLoader | $classLoader | The class loader. |
|
| protected array | $testClasses | Statically cached list of test classes. |
|
| protected array | $testNamespaces | Cached map of all test namespaces to respective directories. |
|
| protected array | $availableExtensions | Cached list of all available extension names, keyed by extension type. |
|
| protected string | $root | The app root. |
Methods
Constructs a new test discovery.
Registers test namespaces of all extensions and core test classes.
Discovers all available tests in all extensions.
Discovers all class files in all available extensions.
Scans a given directory for class files.
Retrieves information about a test class for UI purposes.
Parses the phpDoc summary line of a test class.
Determines the phpunit testsuite for a given classname, based on namespace.
Returns all available extensions.
Details
__construct(string $root, $class_loader)
Constructs a new test discovery.
array
registerTestNamespaces()
Registers test namespaces of all extensions and core test classes.
array
getTestClasses(string $extension = NULL, array $types = [])
Discovers all available tests in all extensions.
array
findAllClassFiles(string $extension = NULL)
Discovers all class files in all available extensions.
static array
scanDirectory(string $namespace_prefix, string $path)
Scans a given directory for class files.
static array
getTestInfo(string $classname, string $doc_comment = NULL)
Retrieves information about a test class for UI purposes.
static string
parseTestClassSummary(string $doc_comment)
Parses the phpDoc summary line of a test class.
static array
parseTestClassAnnotations(ReflectionClass $class)
Parses annotations in the phpDoc of a test class.
static string|false
getPhpunitTestSuite(string $classname)
Determines the phpunit testsuite for a given classname, based on namespace.
protected Extension[]
getExtensions()
Returns all available extensions.