summaryrefslogtreecommitdiffstats
path: root/phpunit-php8.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-09-10 07:52:37 +0200
committerRemi Collet <remi@remirepo.net>2021-09-10 07:52:37 +0200
commit25bb35025d897f29f35352fef7868a306e84ed77 (patch)
treefc21657dc8e61f690b6a9b7c49fad2168f38f5a9 /phpunit-php8.patch
parentcba9992be7a788dcd37f2c5841cb8975c7afd525 (diff)
add minimal fix for PHP 8.1
Diffstat (limited to 'phpunit-php8.patch')
-rw-r--r--phpunit-php8.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/phpunit-php8.patch b/phpunit-php8.patch
index f34a9b6..f57005e 100644
--- a/phpunit-php8.patch
+++ b/phpunit-php8.patch
@@ -66,3 +66,49 @@ diff -up ./tests/Framework/ConstraintTest.php.php8 ./tests/Framework/ConstraintT
$this->assertTrue($constraint->evaluate([true], '', true));
}
+diff -up ./PHPUnit/Util/Configuration.php.old ./PHPUnit/Util/Configuration.php
+--- ./PHPUnit/Util/Configuration.php.old 2021-09-10 07:36:55.786834316 +0200
++++ ./PHPUnit/Util/Configuration.php 2021-09-10 07:38:02.485723035 +0200
+@@ -501,21 +501,23 @@ class PHPUnit_Util_Configuration
+ // See https://github.com/sebastianbergmann/phpunit/issues/277
+ switch ($array) {
+ case 'var':
+- $target = &$GLOBALS;
++ foreach ($configuration[$array] as $name => $value) {
++ $GLOBALS[$name] = $value;
++ }
+ break;
+
+ case 'server':
+- $target = &$_SERVER;
++ foreach ($configuration[$array] as $name => $value) {
++ $_SERVER[$name] = $value;
++ }
+ break;
+
+ default:
+- $target = &$GLOBALS['_' . strtoupper($array)];
++ foreach ($configuration[$array] as $name => $value) {
++ $GLOBALS['_' . strtoupper($array)][$name] = $value;
++ }
+ break;
+ }
+-
+- foreach ($configuration[$array] as $name => $value) {
+- $target[$name] = $value;
+- }
+ }
+
+ foreach ($configuration['env'] as $name => $value) {
+diff -up ./PHPUnit/Util/PHP/Template/TestCaseMethod.tpl.dist.old ./PHPUnit/Util/PHP/Template/TestCaseMethod.tpl.dist
+--- ./PHPUnit/Util/PHP/Template/TestCaseMethod.tpl.dist.old 2021-09-10 07:43:43.165206553 +0200
++++ ./PHPUnit/Util/PHP/Template/TestCaseMethod.tpl.dist 2021-09-10 07:43:46.619201163 +0200
+@@ -81,7 +81,7 @@ if ('' !== $configurationFilePath) {
+ unset($configuration);
+ }
+
+-function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
++function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext=null)
+ {
+ return true;
+ }