3 namespace Drupal\Tests\Core\Listeners;
5 use Drupal\Tests\UnitTestCase;
8 * Test deprecation error handling by DrupalStandardsListener.
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.
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.
25 * @coversDefaultClass \Drupal\deprecation_test\Deprecation\DrupalStandardsListenerDeprecatedClass
27 class DrupalStandardsListenerDeprecationTest extends UnitTestCase {
30 * Exercise DrupalStandardsListener's coverage validation.
32 * @covers ::testFunction
34 public function testDeprecation() {
35 // Meaningless assertion so this test is not risky.
36 $this->assertTrue(TRUE);