You are here

private static function ExternalCommandRequirementsTrait::checkClassCommandRequirements in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/BuildTests/Framework/ExternalCommandRequirementsTrait.php \Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait::checkClassCommandRequirements()
  2. 9 core/tests/Drupal/BuildTests/Framework/ExternalCommandRequirementsTrait.php \Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait::checkClassCommandRequirements()

Checks whether required external commands are available per test class.

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 30

Class

ExternalCommandRequirementsTrait
Allows test classes to require external command line applications.

Namespace

Drupal\BuildTests\Framework

Code

private static function checkClassCommandRequirements() {
  $annotations = Test::parseTestMethodAnnotations(static::class);
  if (!empty($annotations['class']['requires'])) {
    static::checkExternalCommandRequirements($annotations['class']['requires']);
  }
}