From 25bb35025d897f29f35352fef7868a306e84ed77 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 10 Sep 2021 07:52:37 +0200 Subject: add minimal fix for PHP 8.1 --- phpunit-php8.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'phpunit-php8.patch') 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; + } -- cgit