function PhpUnitApiGetTestClassesTest::testSuite
Checks PHPUnit API based discovery.
Attributes
#[DataProvider('argumentsProvider')]
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Test/ PhpUnitApiGetTestClassesTest.php, line 27
Class
- PhpUnitApiGetTestClassesTest
- Tests ::getTestClasses().
Namespace
Drupal\KernelTests\Core\TestCode
public function testSuite(array $suites = [], ?string $extension = NULL, ?string $directory = NULL, array $testsArg = [], ?int $minCount = NULL, ?int $maxCount = NULL) : void {
$configurationFilePath = $this->container
->getParameter('app.root') . \DIRECTORY_SEPARATOR . 'core';
$phpUnitTestDiscovery = PhpUnitTestDiscovery::instance()->setConfigurationFilePath($configurationFilePath);
$phpUnitList = $phpUnitTestDiscovery->getTestClasses($extension, $suites, $directory, $testsArg);
$this->assertNotEmpty($phpUnitList);
if (isset($minCount)) {
$this->assertGreaterThanOrEqual($minCount, count($phpUnitList));
}
if (isset($maxCount)) {
$this->assertLessThanOrEqual($maxCount, count($phpUnitList));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.