You are here

public function ProcessBuilderTest::testInheritEnvironmentVars in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/process/Tests/ProcessBuilderTest.php \Symfony\Component\Process\Tests\ProcessBuilderTest::testInheritEnvironmentVars()

File

vendor/symfony/process/Tests/ProcessBuilderTest.php, line 18

Class

ProcessBuilderTest

Namespace

Symfony\Component\Process\Tests

Code

public function testInheritEnvironmentVars() {
  $_ENV['MY_VAR_1'] = 'foo';
  $proc = ProcessBuilder::create()
    ->add('foo')
    ->getProcess();
  unset($_ENV['MY_VAR_1']);
  $env = $proc
    ->getEnv();
  $this
    ->assertArrayHasKey('MY_VAR_1', $env);
  $this
    ->assertEquals('foo', $env['MY_VAR_1']);
}