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