[php-src] master: Fix tests when stdout is unbuffered (#13924)

From: Date: Tue, 16 Apr 2024 11:49:17 +0000
Subject: [php-src] master: Fix tests when stdout is unbuffered (#13924)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-128131@lists.php.net to get a copy of this message
Author: Arnaud Le Blanc (arnaud-lb) Committer: GitHub (web-flow) Pusher: arnaud-lb Date: 2024-04-16T13:49:11+02:00 Commit: https://github.com/php/php-src/commit/326dc17bb4dd4a9127ba963f8a4b7a7a7933608b Raw diff: https://github.com/php/php-src/commit/326dc17bb4dd4a9127ba963f8a4b7a7a7933608b.diff Fix tests when stdout is unbuffered (#13924) Changed paths: M ext/opcache/tests/issue0115.phpt M ext/opcache/tests/issue0149.phpt Diff: diff --git a/ext/opcache/tests/issue0115.phpt b/ext/opcache/tests/issue0115.phpt index 5e32e1f6fb66d..c31f72e8c63b0 100644 --- a/ext/opcache/tests/issue0115.phpt +++ b/ext/opcache/tests/issue0115.phpt @@ -33,7 +33,13 @@ $p->setStub($stub); unset($p); include "php_cli_server.inc"; -php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX); + +$ini = '-d opcache.enable=1 -d opcache.enable_cli=1'; +if (file_exists(ini_get('extension_dir').'/phar.'.PHP_SHLIB_SUFFIX)) { + $ini .= ' -d extension=phar.'.PHP_SHLIB_SUFFIX; +} +php_cli_server_start($ini); + echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0115_1.phar.php'); echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0115_2.phar.php'); ?> diff --git a/ext/opcache/tests/issue0149.phpt b/ext/opcache/tests/issue0149.phpt index a72a4bc4ee650..29e6f02808a75 100644 --- a/ext/opcache/tests/issue0149.phpt +++ b/ext/opcache/tests/issue0149.phpt @@ -21,7 +21,13 @@ $p->setStub($stub); unset($p); include "php_cli_server.inc"; -php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX); + +$ini = '-d opcache.enable=1 -d opcache.enable_cli=1'; +if (file_exists(ini_get('extension_dir').'/phar.'.PHP_SHLIB_SUFFIX)) { + $ini .= ' -d extension=phar.'.PHP_SHLIB_SUFFIX; +} +php_cli_server_start($ini); + echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php'); echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php'); echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');

« previous php.cvs (#128131) next »