summaryrefslogtreecommitdiffstats
path: root/phpunit7-php8.patch
diff options
context:
space:
mode:
Diffstat (limited to 'phpunit7-php8.patch')
-rw-r--r--phpunit7-php8.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/phpunit7-php8.patch b/phpunit7-php8.patch
index c5c9e06..998785f 100644
--- a/phpunit7-php8.patch
+++ b/phpunit7-php8.patch
@@ -317,3 +317,28 @@ diff -up ./src/Util/PHP/Template/TestCaseMethod.tpl.dist.old ./src/Util/PHP/Temp
{
return true;
}
+diff -up ./src/Framework/Constraint/IsType.php.old ./src/Framework/Constraint/IsType.php
+--- ./src/Framework/Constraint/IsType.php.old 2021-11-23 07:43:17.366683633 +0100
++++ ./src/Framework/Constraint/IsType.php 2021-11-23 07:43:35.332633310 +0100
+@@ -137,7 +137,20 @@ class IsType extends Constraint
+ 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);