From 1d3fa5257b3b01dcdb4005ae9c041224a8be4da6 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 10 Mar 2023 01:38:46 +0100 Subject: [PATCH 1/2] AssertClosedResourceTestCase: update exception message expectation ... for a minor change in the exception message thrown by PHPUnit 10.0. --- tests/Polyfills/AssertClosedResourceTestCase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Polyfills/AssertClosedResourceTestCase.php b/tests/Polyfills/AssertClosedResourceTestCase.php index 3c6d4e2..8b1eba6 100644 --- a/tests/Polyfills/AssertClosedResourceTestCase.php +++ b/tests/Polyfills/AssertClosedResourceTestCase.php @@ -24,7 +24,7 @@ abstract class AssertClosedResourceTestCase extends TestCase { * @return void */ public function isClosedResourceExpectExceptionOnOpenResource( $actual ) { - $pattern = '`^Failed asserting that .+? is of type "resource \(closed\)"`'; + $pattern = '`^Failed asserting that .+? is of type ["]?resource \(closed\)["]?`'; $exception = 'PHPUnit\Framework\AssertionFailedError'; if ( \class_exists( 'PHPUnit_Framework_AssertionFailedError' ) ) { // PHPUnit < 6. @@ -49,7 +49,7 @@ public function isNotClosedResourceExpectExceptionOnClosedResource( $actual ) { * PHPUnit itself will report closed resources as `NULL` prior to Exporter 3.0.4/4.1.4. * See: https://github.com/sebastianbergmann/exporter/pull/37 */ - $pattern = '`^Failed asserting that (resource \(closed\)|NULL) is not of type "resource \(closed\)"`'; + $pattern = '`^Failed asserting that (resource \(closed\)|NULL) is not of type ["]?resource \(closed\)["]?`'; $exception = 'PHPUnit\Framework\AssertionFailedError'; if ( \class_exists( 'PHPUnit_Framework_AssertionFailedError' ) ) { // PHPUnit < 6. From 86657f3bd37765c3950810e465d306d7c8e1381d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 10 Mar 2023 01:41:47 +0100 Subject: [PATCH 2/2] AssertClosedResourceNotResourceTest: update exception message expectation ... for a minor change in the exception message thrown by PHPUnit 10.0. --- tests/Polyfills/AssertClosedResourceNotResourceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Polyfills/AssertClosedResourceNotResourceTest.php b/tests/Polyfills/AssertClosedResourceNotResourceTest.php index b723bdb..912b60f 100644 --- a/tests/Polyfills/AssertClosedResourceNotResourceTest.php +++ b/tests/Polyfills/AssertClosedResourceNotResourceTest.php @@ -31,7 +31,7 @@ final class AssertClosedResourceNotResourceTest extends TestCase { * @return void */ public function testAssertIsClosedResource( $value ) { - $pattern = '`^Failed asserting that .+? is of type "resource \(closed\)"`s'; + $pattern = '`^Failed asserting that .+? is of type ["]?resource \(closed\)["]?`s'; $exception = 'PHPUnit\Framework\AssertionFailedError'; if ( \class_exists( 'PHPUnit_Framework_AssertionFailedError' ) ) { // PHPUnit < 6.