Don't generate script for proc_open_pipes tests

Commit the generated script instead, which is much simpler than
the code generating it...
This commit is contained in:
Nikita Popov 2019-03-04 10:52:50 +01:00
parent e27ba75e0f
commit 6be93b29eb
5 changed files with 5 additions and 51 deletions

View file

@ -1,21 +0,0 @@
<?php
function create_sleep_script()
{
$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";
if (!file_exists($fname)) {
file_put_contents($fname, "<?php\nsleep(1);\n");
}
return $fname;
}
function unlink_sleep_script()
{
$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";
if (file_exists($fname)) {
unlink($fname);
}
}

View file

@ -3,26 +3,17 @@ proc_open() with > 16 pipes
--FILE--
<?php
include dirname(__FILE__) . "/proc_open_pipes.inc";
for ($i = 3; $i<= 30; $i++) {
$spec[$i] = array('pipe', 'w');
}
$php = getenv("TEST_PHP_EXECUTABLE");
$callee = create_sleep_script();
$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
proc_open("$php -n $callee", $spec, $pipes);
var_dump(count($spec));
var_dump($pipes);
?>
--CLEAN--
<?php
include dirname(__FILE__) . "/proc_open_pipes.inc";
unlink_sleep_script();
?>
--EXPECTF--
int(28)

View file

@ -3,24 +3,15 @@ proc_open() with no pipes
--FILE--
<?php
include dirname(__FILE__) . "/proc_open_pipes.inc";
$spec = array();
$php = getenv("TEST_PHP_EXECUTABLE");
$callee = create_sleep_script();
$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
proc_open("$php -n $callee", $spec, $pipes);
var_dump(count($spec));
var_dump($pipes);
?>
--CLEAN--
<?php
include dirname(__FILE__) . "/proc_open_pipes.inc";
unlink_sleep_script();
?>
--EXPECT--
int(0)

View file

@ -3,14 +3,12 @@ proc_open() with invalid pipes
--FILE--
<?php
include dirname(__FILE__) . "/proc_open_pipes.inc";
for ($i = 3; $i<= 5; $i++) {
$spec[$i] = array('pipe', 'w');
}
$php = getenv("TEST_PHP_EXECUTABLE");
$callee = create_sleep_script();
$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
$spec[$i] = array('pi');
proc_open("$php -n $callee", $spec, $pipes);
@ -27,13 +25,6 @@ proc_open("$php -n $callee", $spec, $pipes);
var_dump($pipes);
echo "END\n";
?>
--CLEAN--
<?php
include dirname(__FILE__) . "/proc_open_pipes.inc";
unlink_sleep_script();
?>
--EXPECTF--
Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d

View file

@ -0,0 +1,2 @@
<?php
sleep(1);