public function TestDiscoveryTest::testGetTestInfoEmptyDocblock in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestInfoEmptyDocblock()
- 9 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestInfoEmptyDocblock()
Ensure that classes are not reflected when the docblock is empty.
@covers ::getTestInfo
File
- core/
tests/ Drupal/ Tests/ Core/ Test/ TestDiscoveryTest.php, line 471
Class
- TestDiscoveryTest
- @coversDefaultClass \Drupal\Core\Test\TestDiscovery @group Test
Namespace
Drupal\Tests\Core\TestCode
public function testGetTestInfoEmptyDocblock() {
// If getTestInfo() performed reflection, it won't be able to find the
// class we asked it to analyze, so it will throw a ReflectionException.
// We want to make sure it didn't do that, because we already did some
// analysis and already have an empty docblock. getTestInfo() will throw
// MissingGroupException because the annotation is empty.
$this
->expectException(MissingGroupException::class);
TestDiscovery::getTestInfo('Drupal\\Tests\\ThisTestDoesNotExistTest', '');
}