]> granicus.if.org Git - php/commitdiff
Don't generate script for proc_open_pipes tests
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 4 Mar 2019 09:52:50 +0000 (10:52 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 4 Mar 2019 09:52:50 +0000 (10:52 +0100)
Commit the generated script instead, which is much simpler than
the code generating it...

ext/standard/tests/general_functions/proc_open_pipes.inc [deleted file]
ext/standard/tests/general_functions/proc_open_pipes1.phpt
ext/standard/tests/general_functions/proc_open_pipes2.phpt
ext/standard/tests/general_functions/proc_open_pipes3.phpt
ext/standard/tests/general_functions/proc_open_pipes_sleep.inc [new file with mode: 0644]

diff --git a/ext/standard/tests/general_functions/proc_open_pipes.inc b/ext/standard/tests/general_functions/proc_open_pipes.inc
deleted file mode 100644 (file)
index 576118f..0000000
+++ /dev/null
@@ -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);
-       }
-}
index f3335bc8ce60cb1bad1b9ff53ccccbca3482cc96..dd0550f7fd39dd2484be54a76cac77da3112a089 100644 (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)
index 21734773a32abadb23539fc92f9be39e5ec8fd32..3c1cf9695592fc880e1f44ab2d8b573c7d37b5f3 100644 (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)
index d64987018bd4637f48b6bdfba23d58cfbd8bd32f..7671b1dce179478a4d5d7fcecc8659b69cf89f60 100644 (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
diff --git a/ext/standard/tests/general_functions/proc_open_pipes_sleep.inc b/ext/standard/tests/general_functions/proc_open_pipes_sleep.inc
new file mode 100644 (file)
index 0000000..53eab09
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+sleep(1);