function TestDiscoveryTest::testTestInfoParser
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testTestInfoParser()
- 10 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testTestInfoParser()
- 9 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testTestInfoParser()
- 8.9.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testTestInfoParser()
Tests test info parser.
Attributes
#[DataProvider('infoParserProvider')]
#[RunInSeparateProcess]
File
-
core/
tests/ Drupal/ Tests/ Core/ Test/ TestDiscoveryTest.php, line 27
Class
- TestDiscoveryTest
- Unit tests for test discovery.
Namespace
Drupal\Tests\Core\TestCode
public function testTestInfoParser(array $expected, string $classname) : void {
$configurationFilePath = $this->root . \DIRECTORY_SEPARATOR . 'core';
$phpUnitTestDiscovery = PhpUnitTestDiscovery::instance()->setConfigurationFilePath($configurationFilePath);
$classes = $phpUnitTestDiscovery->getTestClasses(NULL, [
$expected['type'],
]);
$info = $classes[$expected['group']][$classname];
// The 'file' key varies depending on the CI build directory, but that's
// rather irrelevant here. Remove the key before comparison.
unset($info['file']);
$this->assertEquals($expected, $info);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.