class ProcessFactoryTest
@coversDefaultClass \Drupal\package_manager\ProcessFactory @group auto_updates @internal
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait
- class \Drupal\Tests\package_manager\Kernel\PackageManagerKernelTestBase extends \Drupal\KernelTests\KernelTestBase uses \Drupal\Tests\package_manager\Traits\AssertPreconditionsTrait, \Drupal\Tests\package_manager\Traits\ComposerStagerTestTrait, \Drupal\Tests\package_manager\Traits\FixtureManipulatorTrait, \Drupal\Tests\package_manager\Traits\FixtureUtilityTrait, \Drupal\package_manager\StatusCheckTrait, \Drupal\Tests\package_manager\Traits\ValidationTestTrait
- class \Drupal\Tests\package_manager\Kernel\ProcessFactoryTest extends \Drupal\Tests\package_manager\Kernel\PackageManagerKernelTestBase
- class \Drupal\Tests\package_manager\Kernel\PackageManagerKernelTestBase extends \Drupal\KernelTests\KernelTestBase uses \Drupal\Tests\package_manager\Traits\AssertPreconditionsTrait, \Drupal\Tests\package_manager\Traits\ComposerStagerTestTrait, \Drupal\Tests\package_manager\Traits\FixtureManipulatorTrait, \Drupal\Tests\package_manager\Traits\FixtureUtilityTrait, \Drupal\package_manager\StatusCheckTrait, \Drupal\Tests\package_manager\Traits\ValidationTestTrait
Expanded class hierarchy of ProcessFactoryTest
File
-
core/
modules/ package_manager/ tests/ src/ Kernel/ ProcessFactoryTest.php, line 15
Namespace
Drupal\Tests\package_manager\KernelView source
class ProcessFactoryTest extends PackageManagerKernelTestBase {
/**
* Tests that the process factory prepends the PHP directory to PATH.
*/
public function testPhpDirectoryPrependedToPath() : void {
$factory = $this->container
->get(ProcessFactoryInterface::class);
$this->assertInstanceOf(ProcessFactory::class, $factory);
// Ensure that the directory of the PHP interpreter can be found.
$reflector = new \ReflectionObject($factory);
$method = $reflector->getMethod('getPhpDirectory');
$php_dir = $method->invoke(NULL);
$this->assertNotEmpty($php_dir);
// The process factory should always put the PHP interpreter's directory
// at the beginning of the PATH environment variable.
$env = $factory->create([
'whoami',
])
->getEnv();
$this->assertStringStartsWith("{$php_dir}:", $env['PATH']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.