From 3aaddb1c5bd9b9b8d070b4cf120e71c36fd08412 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 17 Nov 2015 19:22:19 +0100 Subject: [PATCH] Fix insulated tests with phpdbg --- src/Util/PHP/Default.php | 7 ++++++- src/Util/PHP/eval-stdin.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/Util/PHP/eval-stdin.php diff --git a/src/Util/PHP/Default.php b/src/Util/PHP/Default.php index f8b5714e5e4..e9649b66192 100644 --- a/src/Util/PHP/Default.php +++ b/src/Util/PHP/Default.php @@ -30,9 +30,14 @@ class PHPUnit_Util_PHP_Default extends PHPUnit_Util_PHP public function runJob($job, array $settings = array()) { $runtime = new Runtime; + $runtime = $runtime->getBinary() . $this->settingsToParameters($settings); + + if ('phpdbg' === PHP_SAPI) { + $runtime .= ' -qrr '.escapeshellarg(__DIR__ . '/eval-stdin.php'); + } $process = proc_open( - $runtime->getBinary() . $this->settingsToParameters($settings), + $runtime, array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), diff --git a/src/Util/PHP/eval-stdin.php b/src/Util/PHP/eval-stdin.php new file mode 100644 index 00000000000..afba6b2e84b --- /dev/null +++ b/src/Util/PHP/eval-stdin.php @@ -0,0 +1,3 @@ +'.file_get_contents('php://input'));