Skip to content

Commit 5ed313d

Browse files
covex-nnElectricMaxxx
authored andcommitted
Do not pass command line as array to Process (#180)
1 parent 5f4fbe6 commit 5ed313d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Phpunit/DatabaseTestListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Doctrine\Common\DataFixtures\Purger;
1515
use Symfony\Component\Process\PhpExecutableFinder;
1616
use Symfony\Component\Process\Process;
17+
use Symfony\Component\Process\ProcessUtils;
1718

1819
class DatabaseTestListener implements \PHPUnit_Framework_TestListener
1920
{
@@ -44,6 +45,10 @@ public function getProcess($arguments)
4445
return $callable($arguments);
4546
}
4647

48+
if (is_array($arguments) && method_exists(ProcessUtils::class, 'escapeArgument')) {
49+
$arguments = implode(' ', array_map([ProcessUtils::class, 'escapeArgument'], $arguments));
50+
}
51+
4752
return new Process($arguments);
4853
}
4954

0 commit comments

Comments
 (0)