diff --git a/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php b/test/ComposerRequireCheckerTest/DependencyGuesser/DependencyGuesserTest.php index 066dabe8..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 { @@ -25,7 +26,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 +41,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); }