function DeprecationHandler::isTestInLegacyGroup

Determines if a test case is part of the 'legacy' group.

Parameters

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

1 call to DeprecationHandler::isTestInLegacyGroup()
DeprecationHandler::isDeprecationTest in core/tests/Drupal/TestTools/Extension/DeprecationBridge/DeprecationHandler.php
Determines if a test case is a deprecation test.

File

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

Class

DeprecationHandler
Drupal's PHPUnit extension to manage code deprecation.

Namespace

Drupal\TestTools\Extension\DeprecationBridge

Code

private static function isTestInLegacyGroup(TestCase $testCase) : bool {
    $groups = [];
    foreach ($testCase->valueObjectForEvents()
        ->metadata()
        ->isGroup() as $metadata) {
        $groups[] = $metadata->groupName();
    }
    return in_array('legacy', $groups, TRUE);
}

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