function TestDiscoveryTest::testGetTestClassesWithSelectedTypes
Same name in this branch
- 8.9.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestClassesWithSelectedTypes()
Same name and namespace in other branches
- 9 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()
- 11.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestClassesWithSelectedTypes()
@covers ::getTestClasses
File
-
core/
modules/ simpletest/ tests/ src/ Unit/ TestDiscoveryTest.php, line 159
Class
- TestDiscoveryTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21simpletest%21src%21TestDiscovery.php/class/TestDiscovery/8.9.x" title="Discovers available tests." class="local">\Drupal\simpletest\TestDiscovery</a>
Namespace
Drupal\Tests\simpletest\UnitCode
public function testGetTestClassesWithSelectedTypes() {
$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.