From b2429259af2d16894121066962410834f0565cbe Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 18 May 2018 17:39:12 +0200 Subject: Fix curl tests wrt. AppVeyor and curl updates --- ext/curl/tests/bug48203-win32.phpt | 5 +++-- ext/curl/tests/bug54798-win32.phpt | 1 - ext/curl/tests/server.inc | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ext/curl/tests/bug48203-win32.phpt b/ext/curl/tests/bug48203-win32.phpt index 947c33a3d1..d3affdb71d 100644 --- a/ext/curl/tests/bug48203-win32.phpt +++ b/ext/curl/tests/bug48203-win32.phpt @@ -30,7 +30,8 @@ echo "Ok\n"; --EXPECTF-- Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d -Hello World! -Hello World!Ok %A +Hello World! +Hello World!* Closing connection 0 +Ok diff --git a/ext/curl/tests/bug54798-win32.phpt b/ext/curl/tests/bug54798-win32.phpt index c3b240dea7..bce39903ba 100644 --- a/ext/curl/tests/bug54798-win32.phpt +++ b/ext/curl/tests/bug54798-win32.phpt @@ -65,4 +65,3 @@ Hello World!Ok for CURLOPT_FILE %AOk for CURLOPT_INFILE ===DONE=== -%A diff --git a/ext/curl/tests/server.inc b/ext/curl/tests/server.inc index ed351b72cb..27f0cbbc84 100644 --- a/ext/curl/tests/server.inc +++ b/ext/curl/tests/server.inc @@ -13,17 +13,23 @@ function curl_cli_server_start() { $doc_root = __DIR__; $router = "responder/get.php"; - $descriptorspec = array( - 0 => STDIN, - 1 => STDOUT, - 2 => STDERR, - ); - if (substr(PHP_OS, 0, 3) == 'WIN') { + $descriptorspec = array( + 0 => STDIN, + 1 => STDOUT, + 2 => array("pipe", "w"), + ); + $cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS; $cmd .= " {$router}"; $handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true)); } else { + $descriptorspec = array( + 0 => STDIN, + 1 => STDOUT, + 2 => STDERR, + ); + $cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS; $cmd .= " {$router}"; $cmd .= " 2>/dev/null"; -- cgit v1.2.1