function TestExecutableFinder::throwFor

Throws an exception when finding a specific executable, for testing.

Parameters

string $name: The name of the executable for which ::find() will throw an exception.

1 call to TestExecutableFinder::throwFor()
DirectWriteTest::testPreconditionBypass in core/modules/package_manager/tests/src/Kernel/DirectWriteTest.php
Tests that direct-write bypasses certain Composer Stager preconditions.

File

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

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::keyValue('package_manager_test.executable_errors')->set($name, TRUE);
}

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