d323a2b433b506c1711b7b9bc3dcc13c976c0b82
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Listeners / DrupalStandardsListenerDeprecationTest.php
1 <?php
2
3 namespace Drupal\Tests\Core\Listeners;
4
5 use Drupal\Tests\UnitTestCase;
6
7 /**
8  * Test deprecation error handling by DrupalStandardsListener.
9  *
10  * DrupalStandardsListener has a dependency on composer/composer, so we can't
11  * test it directly. However, we can create a test which is annotated as
12  * covering a deprecated class. This way we can know whether the standards
13  * listener process ignores deprecation errors.
14  *
15  * Note that this test is annotated as covering
16  * \Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass::testFunction(),
17  * but the reason the test exists is to cover
18  * \Drupal\Tests\Listeners\DrupalStandardsListener::endTest(). We never
19  * actually instantiate
20  * \Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass because that
21  * would trigger another deprecation error.
22  *
23  * @group Listeners
24  *
25  * @coversDefaultClass \Drupal\deprecation_test\Deprecation\DrupalStandardsListenerDeprecatedClass
26  */
27 class DrupalStandardsListenerDeprecationTest extends UnitTestCase {
28
29   /**
30    * Exercise DrupalStandardsListener's coverage validation.
31    *
32    * @covers ::testFunction
33    */
34   public function testDeprecation() {
35     // Meaningless assertion so this test is not risky.
36     $this->assertTrue(TRUE);
37   }
38
39 }