From 8dc28e30cb14ba9c19845b858b7ab7b6d79d8088 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 23 Nov 2021 07:54:28 +0100 Subject: additional fix for PHP 8 --- phpunit7-php8.patch | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'phpunit7-php8.patch') 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); -- cgit