function ExternalCommandRequirementsTrait::checkMethodCommandRequirements

Same name in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/ExternalCommandRequirementsTrait.php \Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait::checkMethodCommandRequirements()
  2. 8.9.x core/tests/Drupal/BuildTests/Framework/ExternalCommandRequirementsTrait.php \Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait::checkMethodCommandRequirements()

Checks whether required external commands are available per method.

Throws

\PHPUnit\Framework\SkippedTestError Thrown when the requirements are not met, and this test should be skipped. Callers should not catch this exception.

File

core/tests/Drupal/BuildTests/Framework/ExternalCommandRequirementsTrait.php, line 52

Class

ExternalCommandRequirementsTrait
Allows test classes to require external command line applications.

Namespace

Drupal\BuildTests\Framework

Code

private static function checkMethodCommandRequirements($name) {
    @trigger_error(__METHOD__ . "() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use Drupal\\TestTools\\Extension\\RequiresComposerTrait instead. See https://www.drupal.org/node/3362239", E_USER_DEPRECATED);
    $annotations = Test::parseTestMethodAnnotations(static::class, $name);
    if (!empty($annotations['method']['requires'])) {
        static::checkExternalCommandRequirements($annotations['method']['requires']);
    }
}

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