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