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