function DeprecationHandler::isDeprecationTest

Determines if a test case is a deprecation test.

Deprecation tests are those that are annotated with '@group legacy' or that have a '#[IgnoreDeprecations]' attribute.

Parameters

\PHPUnit\Framework\TestCase $testCase: The test case being executed.

2 calls to DeprecationHandler::isDeprecationTest()
ExpectDeprecationTrait::expectDeprecation in core/tests/Drupal/TestTools/Extension/DeprecationBridge/ExpectDeprecationTrait.php
Adds an expected deprecation.
TestErrorHandler::__invoke in core/tests/Drupal/TestTools/ErrorHandler/TestErrorHandler.php
Executes when the object is called as a function.

File

core/tests/Drupal/TestTools/Extension/DeprecationBridge/DeprecationHandler.php, line 231

Class

DeprecationHandler
Drupal's PHPUnit extension to manage code deprecation.

Namespace

Drupal\TestTools\Extension\DeprecationBridge

Code

public static function isDeprecationTest(TestCase $testCase) : bool {
    return $testCase->valueObjectForEvents()
        ->metadata()
        ->isIgnoreDeprecations()
        ->isNotEmpty() || self::isTestInLegacyGroup($testCase);
}

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