Skip to content

Commit 2ef5270

Browse files
committed
Revert "ext/standard/tests: work around Windows quoting with tempfiles."
This reverts commit 077d7d6. As it breaks tests in 8.5 and above.
1 parent 9c160f2 commit 2ef5270

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎ext/standard/tests/general_functions/proc_open_null.phpt‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ Null pipes in proc_open()
55

66
$php = getenv('TEST_PHP_EXECUTABLE');
77
$args = getenv('TEST_PHP_EXTRA_ARGS');
8-
$fn = tempnam(sys_get_temp_dir(), "PROC_OPEN_TEST");
9-
$cmd = "$php $args " . escapeshellarg($fn);
10-
file_put_contents($fn, '<?php echo "Test"; fprintf(STDERR, "Error");');
8+
$cmd = "$php $args -r 'echo \"Test\"; fprintf(STDERR, \"Error\");'";
119

1210
$proc = proc_open($cmd, [1 => ['null'], 2 => ['pipe', 'w']], $pipes);
1311
var_dump($pipes);
@@ -18,17 +16,16 @@ $proc = proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['null']], $pipes);
1816
var_dump($pipes);
1917
var_dump(stream_get_contents($pipes[1]));
2018
proc_close($proc);
21-
unlink($fn);
2219

2320
?>
2421
--EXPECT--
2522
array(1) {
2623
[2]=>
27-
resource(6) of type (stream)
24+
resource(4) of type (stream)
2825
}
2926
string(5) "Error"
3027
array(1) {
3128
[1]=>
32-
resource(8) of type (stream)
29+
resource(6) of type (stream)
3330
}
3431
string(4) "Test"

‎ext/standard/tests/general_functions/proc_open_redirect.phpt‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ try {
2626
}
2727

2828
echo "\nWith pipe:\n";
29-
$fn = tempnam(sys_get_temp_dir(), "PROC_OPEN_TEST");
30-
file_put_contents($fn, '<?php echo "Test\n"; fprintf(STDERR, "Error");');
31-
$cmd = "$php $args " . escapeshellarg($fn);
29+
$cmd = "$php $args -r 'echo \"Test\n\"; fprintf(STDERR, \"Error\");'";
3230
$proc = proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['redirect', 1]], $pipes);
3331
var_dump($pipes);
3432
var_dump(stream_get_contents($pipes[1]));
@@ -54,7 +52,6 @@ unlink($fileName);
5452
echo "\nWith inherited stdout:\n";
5553
$proc = proc_open($cmd, [2 => ['redirect', 1]], $pipes);
5654
proc_close($proc);
57-
unlink($fn);
5855

5956
?>
6057
--EXPECTF--
@@ -66,7 +63,7 @@ Warning: proc_open(): Redirection target 42 not found in %s
6663
With pipe:
6764
array(1) {
6865
[1]=>
69-
resource(6) of type (stream)
66+
resource(4) of type (stream)
7067
}
7168
string(10) "Test
7269
Error"

0 commit comments

Comments
 (0)