summaryrefslogtreecommitdiffstats
path: root/phpunit-php8.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-11-23 07:55:13 +0100
committerRemi Collet <remi@php.net>2021-11-23 07:55:13 +0100
commitf16c69e335a9976a01bbadd6126a81ae4de2709c (patch)
treee7905cc23f37d5195c0a6359577b215cdfd19320 /phpunit-php8.patch
parent25bb35025d897f29f35352fef7868a306e84ed77 (diff)
additional fix for PHP 8
Diffstat (limited to 'phpunit-php8.patch')
-rw-r--r--phpunit-php8.patch25
1 files changed, 25 insertions, 0 deletions
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);