function PhpUnitTestDiscovery::findAllClassFiles
Discovers all class files in all available extensions.
Parameters
string|null $extension: (optional) The name of an extension to limit discovery to; e.g., 'node'.
string|null $directory: (optional) Limit discovered tests to a specific directory.
Return value
array A classmap containing all discovered class files; i.e., a map of fully-qualified classnames to path names.
File
-
core/
lib/ Drupal/ Core/ Test/ PhpUnitTestDiscovery.php, line 144
Class
- PhpUnitTestDiscovery
- Discovers available tests using the PHPUnit API.
Namespace
Drupal\Core\TestCode
public function findAllClassFiles(?string $extension = NULL, ?string $directory = NULL) : array {
$testClasses = $this->getTestClasses($extension, [], $directory);
$classMap = [];
foreach ($testClasses as $group) {
foreach ($group as $className => $info) {
$classMap[$className] = $info['file'];
}
}
return $classMap;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.