From 1e21c2bbb2707e293f2922cd11bcb68a7071d82b Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 27 Feb 2023 10:07:04 +0000 Subject: [PATCH 1/2] Make tests compatible with PHPUnit version 9.6 --- .../DependencyGuesser/DependencyGuesserTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php b/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php index 066dabe8..d502e28c 100644 --- a/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php +++ b/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php @@ -25,7 +25,7 @@ public function testGuessExtJson(): void $this->markTestSkipped('extension json is not available'); } - $result = $this->guesser->__invoke('json_decode'); + $result = iterator_to_array($this->guesser->__invoke('json_decode')); $this->assertNotEmpty($result); $this->assertContains('ext-json', $result); } @@ -40,7 +40,7 @@ public function testCoreExtensionsResolvesToPHP(): void { $options = new Options(['php-core-extensions' => ['SPL', 'something-else']]); $this->guesser = new DependencyGuesser($options); - $result = $this->guesser->__invoke('RecursiveDirectoryIterator'); + $result = iterator_to_array($this->guesser->__invoke('RecursiveDirectoryIterator')); $this->assertNotEmpty($result); $this->assertContains('php', $result); } From 40bdcd65d92636e4aad5ad907b3897ec34f08548 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 27 Feb 2023 10:17:12 +0000 Subject: [PATCH 2/2] Add 'use function' statement via vendor/bin/phpcbf --- .../DependencyGuesser/DependencyGuesserTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php b/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php index d502e28c..7341cc0e 100644 --- a/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php +++ b/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php @@ -9,6 +9,7 @@ use PHPUnit\Framework\TestCase; use function extension_loaded; +use function iterator_to_array; final class DependencyGuesserTest extends TestCase {