function TestExecutableFinder::throwFor

Sets up an exception to throw when trying to find a specific executable.

Parameters

string $name: The name of an executable to look for.

1 call to TestExecutableFinder::throwFor()
ComposerRequirementTest::testComposerInfoShown in core/modules/package_manager/tests/src/Functional/ComposerRequirementTest.php
Tests that Composer version and path are listed on the status report.

File

core/modules/package_manager/tests/modules/package_manager_test_validation/src/TestExecutableFinder.php, line 28

Class

TestExecutableFinder
A test-only executable finder that can be rigged to throw an exception.

Namespace

Drupal\package_manager_test_validation

Code

public static function throwFor(string $name) : void {
  \Drupal::state()->set("throw for {$name}", TRUE);
}

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