From f63d3b2c940a10373faeb1b7e8e8b75edee71588 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 28 Dec 2016 19:14:42 +0100 Subject: [PATCH] display the command being executed If you want to pass environment variables to your tests (for example, to make use of Xdebug), you need to execute the actual process being run by the PHPUnit bridge wrapper. Displaying the commands being executed makes it easier to run them yourself. --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index a832b68b48e6e..90092051c607f 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -117,8 +117,10 @@ if ($components) { } $c = escapeshellarg($component); + $executedCommand = sprintf($cmd, $c, " > $c/phpunit.stdout 2> $c/phpunit.stderr"); + echo "Run \e[32m".$executedCommand."\e[0m\n\n"; - if ($proc = proc_open(sprintf($cmd, $c, " > $c/phpunit.stdout 2> $c/phpunit.stderr"), array(), $pipes)) { + if ($proc = proc_open($executedCommand, array(), $pipes)) { $runningProcs[$component] = $proc; } else { $exit = 1; @@ -183,7 +185,10 @@ if ($components) { // Run regular phpunit in a subprocess $errFile = tempnam(sys_get_temp_dir(), 'phpunit.stderr.'); - if ($proc = proc_open(sprintf($cmd, '', ' 2> '.escapeshellarg($errFile)), array(1 => array('pipe', 'w')), $pipes)) { + $executedCommand = sprintf($cmd, '', ' 2> '.escapeshellarg($errFile)); + echo "Run \e[32m".$executedCommand."\e[0m\n\n"; + + if ($proc = proc_open($executedCommand, array(1 => array('pipe', 'w')), $pipes)) { stream_copy_to_stream($pipes[1], STDOUT); fclose($pipes[1]); $exit = proc_close($proc);