Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix insulated tests with phpdbg #1956

Merged
merged 1 commit into from Nov 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'));