Skip to content

Commit f8a68fd

Browse files
committed
Add test for bug #78106
Also add PHP_TEST_EXTRA_ARGS environment variable, which allows to pass on -c, -d etc flags provided by run-tests.php. Otherwise we won't get the built-in server to run with opcache.
1 parent feb92ad commit f8a68fd

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

ext/opcache/tests/bug78106.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Bug #78106: PHP Fatal error: Uncaught Error: Class 'Phpfastcache\Config\Config' not found
3+
--XFAIL--
4+
Not fixed yet
5+
--FILE--
6+
<?php
7+
8+
include __DIR__ . "/php_cli_server.inc";
9+
php_cli_server_start(getenv('TEST_PHP_EXTRA_ARGS'));
10+
11+
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test1.php" );
12+
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test2.php" );
13+
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test1.php" );
14+
15+
?>
16+
--EXPECT--
17+
included
18+
done
19+
included
20+
done
21+
included
22+
done
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
echo "included\n";

ext/opcache/tests/bug78106_test1.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
ini_set('opcache.enable', 0);
4+
require_once 'bug78106_include.inc';
5+
6+
echo "done\n";

ext/opcache/tests/bug78106_test2.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
require_once 'bug78106_include.inc';
4+
5+
echo "done\n";

run-tests.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ function save_or_mail_results()
820820
if (substr(PHP_OS, 0, 3) == "WIN") {
821821
$pass_options .= " -c " . escapeshellarg($conf_passed);
822822
} else {
823-
$pass_options .= " -c '$conf_passed'";
823+
$pass_options .= " -c '" . realpath($conf_passed) . "'";
824824
}
825825
}
826826

@@ -1611,6 +1611,8 @@ function run_test($php, $file, $env)
16111611

16121612
settings2params($ini_settings);
16131613

1614+
$env['TEST_PHP_EXTRA_ARGS'] = $pass_options . ' ' . $ini_settings;
1615+
16141616
// Check if test should be skipped.
16151617
$info = '';
16161618
$warn = false;

0 commit comments

Comments
 (0)