From 23a11e07dca0b7ee6771819a606d82b0b1ad5a16 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 5 Jan 2025 19:32:10 +0100 Subject: [PATCH] AssertIsType::assertIsResource(): add extra test with closed resource --- tests/Polyfills/AssertIsTypeTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Polyfills/AssertIsTypeTest.php b/tests/Polyfills/AssertIsTypeTest.php index 9b859b2..9c0529b 100644 --- a/tests/Polyfills/AssertIsTypeTest.php +++ b/tests/Polyfills/AssertIsTypeTest.php @@ -80,6 +80,18 @@ public function testAssertIsResource() { \closedir( $resource ); } + /** + * Verify assertIsResource() method handles closed resources correctly. + * + * @return void + */ + public function testAssertIsResourceAllowsForClosedResources() { + $resource = \opendir( __DIR__ ); + \closedir( $resource ); + + $this->assertIsResource( $resource ); + } + /** * Verify availability of the assertIsArray() method. *