diff options
-rw-r--r-- | php-phpunit-PHPUnit.spec | 5 | ||||
-rw-r--r-- | phpunit-php8.patch | 25 |
2 files changed, 29 insertions, 1 deletions
diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec index 9dd05a6..a4acba9 100644 --- a/php-phpunit-PHPUnit.spec +++ b/php-phpunit-PHPUnit.spec @@ -25,7 +25,7 @@ Name: php-phpunit-PHPUnit Version: %{major}.%{minor} -Release: 15%{?dist} +Release: 16%{?dist} Summary: The PHP Unit Testing framework version 5 License: BSD @@ -277,6 +277,9 @@ fi %changelog +* Tue Nov 23 2021 Remi Collet <remi@remirepo.net> - 5.7.27-16 +- additional fix for PHP 8 + * Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 5.7.27-15 - add minimal fix for PHP 8.1 diff --git a/phpunit-php8.patch b/phpunit-php8.patch index f57005e..8143a3a 100644 --- a/phpunit-php8.patch +++ b/phpunit-php8.patch @@ -112,3 +112,28 @@ diff -up ./PHPUnit/Util/PHP/Template/TestCaseMethod.tpl.dist.old ./PHPUnit/Util/ { return true; } +diff -up ./PHPUnit/Framework/Constraint/IsType.php.old ./PHPUnit/Framework/Constraint/IsType.php +--- ./PHPUnit/Framework/Constraint/IsType.php.old 2021-11-23 07:39:40.865503163 +0100 ++++ ./PHPUnit/Framework/Constraint/IsType.php 2021-11-23 07:39:58.420422741 +0100 +@@ -116,7 +116,20 @@ class PHPUnit_Framework_Constraint_IsTyp + return is_object($other); + + case 'resource': +- return is_resource($other) || is_string(@get_resource_type($other)); ++ if (is_resource($other)) { ++ return true; ++ } ++ ++ try { ++ $resource = @get_resource_type($other); ++ ++ if (is_string($resource)) { ++ return true; ++ } ++ } catch (\TypeError $e) { ++ } ++ ++ return false; + + case 'scalar': + return is_scalar($other); |