]> granicus.if.org Git - php/commitdiff
fix tests on linux
authorAnatol Belski <ab@php.net>
Mon, 29 Sep 2014 16:12:25 +0000 (18:12 +0200)
committerAnatol Belski <ab@php.net>
Mon, 29 Sep 2014 16:12:25 +0000 (18:12 +0200)
ext/standard/tests/streams/proc_open_bug60120.phpt
ext/standard/tests/streams/proc_open_bug64438.phpt

index 978cbe62fe85627adccbbc3aa435e1f4b0ce149e..8768257a2ea975d433277c67d2e37ba3c3e66a92 100644 (file)
@@ -4,7 +4,11 @@ Bug #60120 proc_open hangs with stdin/out with 2048+ bytes
 <?php
 error_reporting(E_ALL);
 
-$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+       $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+} else {
+       $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
+}
 $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
 $stdin = str_repeat('*', 1024 * 16) . '!';
 $stdin = str_repeat('*', 2049 );
index e3288518d7fd105862634fc2fabdde52bb3fdd08..b3857d09d428661e8fefc3d366b9c267fc162bfe 100644 (file)
@@ -5,7 +5,11 @@ Bug #64438 proc_open hangs with stdin/out with 4097+ bytes
 
 error_reporting(E_ALL);
 
-$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+       $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+} else {
+       $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
+}
 $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
 $stdin = str_repeat('*', 4097);