public function ProcessBuilderTest::testProcessShouldInheritAndOverrideEnvironmentVars in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/process/Tests/ProcessBuilderTest.php \Symfony\Component\Process\Tests\ProcessBuilderTest::testProcessShouldInheritAndOverrideEnvironmentVars()
File
- vendor/
symfony/ process/ Tests/ ProcessBuilderTest.php, line 51
Class
Namespace
Symfony\Component\Process\TestsCode
public function testProcessShouldInheritAndOverrideEnvironmentVars() {
$_ENV['MY_VAR_1'] = 'foo';
$proc = ProcessBuilder::create()
->setEnv('MY_VAR_1', 'bar')
->add('foo')
->getProcess();
unset($_ENV['MY_VAR_1']);
$env = $proc
->getEnv();
$this
->assertArrayHasKey('MY_VAR_1', $env);
$this
->assertEquals('bar', $env['MY_VAR_1']);
}