Skip to content

Commit

Permalink
Fix insulated tests with phpdbg
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 17, 2015
1 parent 6f9251d commit 3aaddb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Util/PHP/Default.php
Expand Up @@ -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'),
Expand Down
3 changes: 3 additions & 0 deletions src/Util/PHP/eval-stdin.php
@@ -0,0 +1,3 @@
<?php

eval('?>'.file_get_contents('php://input'));

0 comments on commit 3aaddb1

Please sign in to comment.