From dd44a9330e7443d3b88acc8c5c24503562b5d1e8 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 12 Apr 2023 12:36:46 +0200 Subject: [PATCH] Fix test bug60120.phpt The process cmd was broken. We're now also checking that the process output is actually what we expect. Closes GH-11064 --- ext/standard/tests/file/bug60120.phpt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 0236e9e1ea7..811ac786c8e 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -6,6 +6,7 @@ $php = getenv('TEST_PHP_EXECUTABLE'); if (!$php) { die("skip No php executable defined\n"); } +if (PHP_OS_FAMILY === 'Windows') die('skip not for Windows'); ?> --FILE-- = $stdinLen) { fclose($writePipes[0]); @@ -58,12 +62,21 @@ while ($pipes || $writePipes) { foreach ($r as $pipe) { $type = array_search($pipe, $pipes); $data = fread($pipe, 8192); - if (false === $data || feof($pipe)) { + if (feof($pipe)) { fclose($pipe); unset($pipes[$type]); + } elseif (false === $data) { + die('Failed to read from pipe'); + } else { + $procOutput[$type] = ($procOutput[$type] ?? '') . $data; } } } +foreach ($procOutput as $output) { + if ($output !== $stdin) { + die('Output does not match input: ' . $output); + } +} echo "OK."; ?> --EXPECT--