6d4f44888a046f8d6dc182d015512c45d2791eff
[yaffs-website] / web / core / modules / simpletest / tests / src / Kernel / TestDiscoveryDeprecationTest.php
1 <?php
2
3 namespace Drupal\Tests\simpletest\Kernel;
4
5 use Drupal\KernelTests\KernelTestBase;
6
7 /**
8  * @group simpletest
9  * @group legacy
10  *
11  * @coversDefaultClass \Drupal\simpletest\TestDiscovery
12  */
13 class TestDiscoveryDeprecationTest extends KernelTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['simpletest', 'simpletest_deprecation_test'];
19
20   /**
21    * @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
22    * @covers ::getTestClasses
23    */
24   public function testHookSimpletestAlter() {
25     // The simpletest_test module implements hook_simpletest_alter(), which
26     // should trigger a deprecation error during getTestClasses().
27     $this->assertNotEmpty(
28       $this->container->get('test_discovery')->getTestClasses()
29     );
30   }
31
32 }