public function ExternalCommandRequirementTest::testClassRequiresAvailable in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/BuildTests/Framework/Tests/ExternalCommandRequirementTest.php \Drupal\BuildTests\Framework\Tests\ExternalCommandRequirementTest::testClassRequiresAvailable()
@covers ::checkClassCommandRequirements
File
- core/
tests/ Drupal/ BuildTests/ Framework/ Tests/ ExternalCommandRequirementTest.php, line 59
Class
- ExternalCommandRequirementTest
- @coversDefaultClass \Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait @group Build
Namespace
Drupal\BuildTests\Framework\TestsCode
public function testClassRequiresAvailable() {
$requires = new ClassRequiresAvailable();
$ref_check = new \ReflectionMethod($requires, 'checkClassCommandRequirements');
$ref_check
->setAccessible(TRUE);
// Use a try/catch block because otherwise PHPUnit might think this test is
// legitimately skipped.
try {
$this
->assertNull($ref_check
->invoke($requires));
} catch (SkippedTestError $exception) {
$this
->fail(sprintf('The external command should be available: %s', $exception
->getMessage()));
}
}