function TestDiscoveryDeprecationTest::testHookSimpletestAlter

@expectedDeprecation The deprecated alter hook hook_simpletest_alter() is implemented in these functions: simpletest_deprecation_test_simpletest_alter. Convert your test to a PHPUnit-based one and implement test listeners. See: https://www.drupal.org/node/2939892 @covers ::getTestClasses

File

core/modules/simpletest/tests/src/Kernel/TestDiscoveryDeprecationTest.php, line 25

Class

TestDiscoveryDeprecationTest
@group simpletest @group legacy

Namespace

Drupal\Tests\simpletest\Kernel

Code

public function testHookSimpletestAlter() {
    $test_discovery = $this->container
        ->get('test_discovery');
    $this->assertEquals(TestDiscovery::class, get_class($test_discovery));
    // The simpletest_test module implements hook_simpletest_alter(), which
    // should trigger a deprecation error during getTestClasses().
    $this->assertNotEmpty($test_discovery->getTestClasses());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.