com php-src: Add test for bug #78106: ext/opcache/tests/bug78106.phpt ext/opcache/tests/bug78106_include.inc ext/opca che/tests/bug78106_test1.php
ext/opcache/test s/bug78106_test2.php run-tests.php
| From: | Christoph Michael Becker | Date: | Tue, 18 Jun 2019 07:03:37 +0000 |
| Subject: | com php-src: Add test for bug #78106: ext/opcache/tests/bug78106.phpt ext/opcache/tests/bug78106_include.inc ext/opca che/tests/bug78106_test1.php ext/opcache/test s/bug78106_test2.php run-tests.php |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106858@lists.php.net to get a copy of this message | ||
Commit: b6af9da5a0e72d3a295616be2783e4ee4f9d0dd4
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 13 Jun 2019 12:35:29 +0200
Committer: Christoph M. Becker <cmbecker69@gmx.de> Tue, 18 Jun 2019 09:03:37 +0200
Parents: 4c6de12b2d3641dd30c51506eb41546b4d66c3d7
Branches: PHP-7.3.7
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b6af9da5a0e72d3a295616be2783e4ee4f9d0dd4
Log:
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.
(cherry picked from commit f8a68fd9350ac97d33d1773453c4e9d47a97b33f)
Bugs:
https://bugs.php.net/78106
Changed paths:
A ext/opcache/tests/bug78106.phpt
A ext/opcache/tests/bug78106_include.inc
A ext/opcache/tests/bug78106_test1.php
A ext/opcache/tests/bug78106_test2.php
M run-tests.php
Diff:
diff --git a/ext/opcache/tests/bug78106.phpt b/ext/opcache/tests/bug78106.phpt
new file mode 100644
index 0000000..86c8acd
--- /dev/null
+++ b/ext/opcache/tests/bug78106.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #78106: PHP Fatal error: Uncaught Error: Class 'Phpfastcache\Config\Config' not found
+--XFAIL--
+Not fixed yet
+--FILE--
+<?php
+
+include __DIR__ . "/php_cli_server.inc";
+php_cli_server_start(getenv('TEST_PHP_EXTRA_ARGS'));
+
+echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS .
"/bug78106_test1.php" );
+echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS .
"/bug78106_test2.php" );
+echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS .
"/bug78106_test1.php" );
+
+?>
+--EXPECT--
+included
+done
+included
+done
+included
+done
diff --git a/ext/opcache/tests/bug78106_include.inc b/ext/opcache/tests/bug78106_include.inc
new file mode 100644
index 0000000..06e3927
--- /dev/null
+++ b/ext/opcache/tests/bug78106_include.inc
@@ -0,0 +1,3 @@
+<?php
+
+echo "included\n";
diff --git a/ext/opcache/tests/bug78106_test1.php b/ext/opcache/tests/bug78106_test1.php
new file mode 100644
index 0000000..85216d4
--- /dev/null
+++ b/ext/opcache/tests/bug78106_test1.php
@@ -0,0 +1,6 @@
+<?php
+
+ini_set('opcache.enable', 0);
+require_once 'bug78106_include.inc';
+
+echo "done\n";
diff --git a/ext/opcache/tests/bug78106_test2.php b/ext/opcache/tests/bug78106_test2.php
new file mode 100644
index 0000000..6a6aa75
--- /dev/null
+++ b/ext/opcache/tests/bug78106_test2.php
@@ -0,0 +1,5 @@
+<?php
+
+require_once 'bug78106_include.inc';
+
+echo "done\n";
diff --git a/run-tests.php b/run-tests.php
index 6491507..7b20b0b 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -818,7 +818,7 @@ HELP;
if (substr(PHP_OS, 0, 3) == "WIN") {
$pass_options .= " -c " . escapeshellarg($conf_passed);
} else {
- $pass_options .= " -c '$conf_passed'";
+ $pass_options .= " -c '" . realpath($conf_passed) . "'";
}
}
@@ -1600,6 +1600,8 @@ TEST $file
settings2params($ini_settings);
+ $env['TEST_PHP_EXTRA_ARGS'] = $pass_options . ' ' . $ini_settings;
+
// Check if test should be skipped.
$info = '';
$warn = false;