Permalink
Browse files

bug #23498 [Process] Fixed issue between process builder and exec (ly…

…rixx)

This PR was merged into the 3.3 branch.

Discussion
----------

[Process] Fixed issue between process builder and exec

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes/
| Fixed tickets | #23495
| License       | MIT
| Doc PR        | -

Commits
-------

8cd1a2d [Process] Fixed issue between process builder and exec
  • Loading branch information...
nicolas-grekas committed Jul 13, 2017
2 parents e8b9e25 + 8cd1a2d commit 54435997ee91dfccc978fb15e38fcd3180599e22
@@ -272,6 +272,9 @@ public function getProcess()
$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 @@ public function testInvalidInput()
$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());
}
}

0 comments on commit 5443599

Please sign in to comment.