Skip to content

Commit 326dc17

Browse files
authored
Fix tests when stdout is unbuffered (php#13924)
1 parent a64fc00 commit 326dc17

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ext/opcache/tests/issue0115.phpt

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ $p->setStub($stub);
3333
unset($p);
3434

3535
include "php_cli_server.inc";
36-
php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX);
36+
37+
$ini = '-d opcache.enable=1 -d opcache.enable_cli=1';
38+
if (file_exists(ini_get('extension_dir').'/phar.'.PHP_SHLIB_SUFFIX)) {
39+
$ini .= ' -d extension=phar.'.PHP_SHLIB_SUFFIX;
40+
}
41+
php_cli_server_start($ini);
42+
3743
echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0115_1.phar.php');
3844
echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0115_2.phar.php');
3945
?>

ext/opcache/tests/issue0149.phpt

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ $p->setStub($stub);
2121
unset($p);
2222

2323
include "php_cli_server.inc";
24-
php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX);
24+
25+
$ini = '-d opcache.enable=1 -d opcache.enable_cli=1';
26+
if (file_exists(ini_get('extension_dir').'/phar.'.PHP_SHLIB_SUFFIX)) {
27+
$ini .= ' -d extension=phar.'.PHP_SHLIB_SUFFIX;
28+
}
29+
php_cli_server_start($ini);
30+
2531
echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
2632
echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
2733
echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');

0 commit comments

Comments
 (0)