function TestDiscoveryTest::testGetTestClassesWithSelectedTypes
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestClassesWithSelectedTypes()
- 8.9.x core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php \Drupal\Tests\simpletest\Unit\TestDiscoveryTest::testGetTestClassesWithSelectedTypes()
- 8.9.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestClassesWithSelectedTypes()
- 10 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestClassesWithSelectedTypes()
@covers ::getTestClasses
File
-
core/
tests/ Drupal/ Tests/ Core/ Test/ TestDiscoveryTest.php, line 371
Class
- TestDiscoveryTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Test%21TestDiscovery.php/class/TestDiscovery/11.x" title="Discovers available tests." class="local">\Drupal\Core\Test\TestDiscovery</a> @group Test
Namespace
Drupal\Tests\Core\TestCode
public function testGetTestClassesWithSelectedTypes() : void {
$this->setupVfsWithTestClasses();
$extensions = [
'test_module' => new Extension('vfs://drupal', 'module', 'modules/test_module/test_module.info.yml'),
'test_profile_module' => new Extension('vfs://drupal', 'profile', 'profiles/test_profile/modules/test_profile_module/test_profile_module.info.yml'),
];
$test_discovery = $this->getTestDiscoveryMock('vfs://drupal', $extensions);
$result = $test_discovery->getTestClasses(NULL, [
'PHPUnit-Kernel',
]);
$this->assertCount(4, $result);
$this->assertEquals([
'example' => [],
'example2' => [
'Drupal\\Tests\\test_module\\Kernel\\KernelExampleTest3' => [
'name' => 'Drupal\\Tests\\test_module\\Kernel\\KernelExampleTest3',
'description' => 'Test description',
'group' => 'example2',
'groups' => [
'example2',
'kernel',
],
'type' => 'PHPUnit-Kernel',
],
],
'kernel' => [
'Drupal\\Tests\\test_module\\Kernel\\KernelExampleTest3' => [
'name' => 'Drupal\\Tests\\test_module\\Kernel\\KernelExampleTest3',
'description' => 'Test description',
'group' => 'example2',
'groups' => [
'example2',
'kernel',
],
'type' => 'PHPUnit-Kernel',
],
],
'example3' => [
'Drupal\\Tests\\test_profile_module\\Kernel\\KernelExampleTest4' => [
'name' => 'Drupal\\Tests\\test_profile_module\\Kernel\\KernelExampleTest4',
'description' => 'Test description',
'group' => 'example3',
'groups' => [
'example3',
],
'type' => 'PHPUnit-Kernel',
],
],
], $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.