summaryrefslogtreecommitdiffstats
path: root/phpunit-php8.patch
diff options
context:
space:
mode:
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);