Skip to content

Commit

Permalink
Merge branch '3.3' into 3.4
Browse files Browse the repository at this point in the history
* 3.3:
  [Profiler] Fix data collector getCasters() call
  remove symfony/process suggestion
  [DI] Remove unused dynamic property
  [Process] Fixed issue between process builder and exec
  non-conflicting anonymous service ids across files
  • Loading branch information
nicolas-grekas committed Jul 15, 2017
2 parents 2695aab + 0743280 commit aeea12f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ProcessBuilder.php
Expand Up @@ -268,6 +268,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();
Expand Down
13 changes: 13 additions & 0 deletions Tests/ProcessBuilderTest.php
Expand Up @@ -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 aeea12f

Please sign in to comment.