Skip to content

Commit 859913f

Browse files
committed
fix tests on linux
1 parent 91d3cd8 commit 859913f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ext/standard/tests/streams/proc_open_bug60120.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ Bug #60120 proc_open hangs with stdin/out with 2048+ bytes
44
<?php
55
error_reporting(E_ALL);
66

7-
$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
7+
if (substr(PHP_OS, 0, 3) == 'WIN') {
8+
$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
9+
} else {
10+
$cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
11+
}
812
$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
913
$stdin = str_repeat('*', 1024 * 16) . '!';
1014
$stdin = str_repeat('*', 2049 );

ext/standard/tests/streams/proc_open_bug64438.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ Bug #64438 proc_open hangs with stdin/out with 4097+ bytes
55

66
error_reporting(E_ALL);
77

8-
$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
8+
if (substr(PHP_OS, 0, 3) == 'WIN') {
9+
$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
10+
} else {
11+
$cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
12+
}
913
$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
1014
$stdin = str_repeat('*', 4097);
1115

0 commit comments

Comments
 (0)