public function ProcessBuilderTest::shouldInheritEnvironmentVars

@test

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php, line 21

Class

ProcessBuilderTest

Namespace

Symfony\Component\Process\Tests

Code

public function shouldInheritEnvironmentVars() {
  $snapshot = $_ENV;
  $_ENV = $expected = array(
    'foo' => 'bar',
  );
  $pb = new ProcessBuilder();
  $pb
    ->add('foo')
    ->inheritEnvironmentVariables();
  $proc = $pb
    ->getProcess();
  $this
    ->assertNull($proc
    ->getEnv(), '->inheritEnvironmentVariables() copies $_ENV');
  $_ENV = $snapshot;
}