parent
e8b9e253e8
commit
8cd1a2d527
@ -272,6 +272,9 @@ class ProcessBuilder
|
||||
|
||||
$arguments = array_merge($this->prefix, $this->arguments);
|
||||
$process = new Process($arguments, $this->cwd, $this->env, $this->input, $this->timeout, $this->options);
|
||||
// to preserve the BC with symfony <3.3, we convert the array structure
|
||||
// to a string structure to avoid the prefixing with the exec command
|
||||
$process->setCommandLine($process->getCommandLine());
|
||||
|
||||
if ($this->inheritEnv) {
|
||||
$process->inheritEnvironmentVariables();
|
||||
|
@ -210,4 +210,17 @@ class ProcessBuilderTest extends TestCase
|
||||
$builder = ProcessBuilder::create();
|
||||
$builder->setInput(array());
|
||||
}
|
||||
|
||||
public function testDoesNotPrefixExec()
|
||||
{
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
$this->markTestSkipped('This test cannot run on Windows.');
|
||||
}
|
||||
|
||||
$builder = ProcessBuilder::create(array('command', '-v', 'ls'));
|
||||
$process = $builder->getProcess();
|
||||
$process->run();
|
||||
|
||||
$this->assertTrue($process->isSuccessful());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user