diff --git a/tests/Autoload/CommandTest.php b/tests/Autoload/CommandTest.php index 7fe422c..c6845c6 100644 --- a/tests/Autoload/CommandTest.php +++ b/tests/Autoload/CommandTest.php @@ -44,7 +44,10 @@ $mock = AutoloadManager::partialMock(); $mock->run(); - expect(array_values($mock->getRegisteredCommands()))->toEqualCanonicalizing(array_values($this->commands)); + $expected = array_values($this->commands); + $registered = array_values($mock->getRegisteredCommands()); + expect($registered)->toHaveCount(count($expected)); + expect($registered)->each(fn ($item) => $item->toBeIn($expected)); }); }); @@ -57,7 +60,8 @@ $mock = AutoloadManager::partialMock(); $mock->run(); - expect(array_values($mock->getRegisteredCommands()))->toEqualCanonicalizing([]); + $registered = array_values($mock->getRegisteredCommands()); + expect($registered)->toHaveCount(0); }); it('can bust the cache', function () { @@ -69,6 +73,9 @@ $mock = AutoloadManager::partialMock(); $mock->run(); - expect(array_values($mock->getRegisteredCommands()))->toEqualCanonicalizing(array_values($this->commands)); + $expected = array_values($this->commands); + $registered = array_values($mock->getRegisteredCommands()); + expect($registered)->toHaveCount(count($expected)); + expect($registered)->each(fn ($item) => $item->toBeIn($expected)); }); }); diff --git a/tests/Autoload/ProviderTest.php b/tests/Autoload/ProviderTest.php index da2864f..6ae82ad 100644 --- a/tests/Autoload/ProviderTest.php +++ b/tests/Autoload/ProviderTest.php @@ -59,7 +59,10 @@ $mock = AutoloadManager::partialMock(); $mock->run(); - expect(array_values($mock->getRegisteredProviders()))->toEqualCanonicalizing($this->providers); + $expected = array_values($this->providers); + $registered = array_values($mock->getRegisteredProviders()); + expect($registered)->toHaveCount(count($expected)); + expect($registered)->each(fn ($item) => $item->toBeIn($expected)); }); }); @@ -72,7 +75,8 @@ $mock = AutoloadManager::partialMock(); $mock->run(); - expect(array_values($mock->getRegisteredProviders()))->toEqualCanonicalizing([]); + $registered = array_values($mock->getRegisteredProviders()); + expect($registered)->toHaveCount(0); }); it('can bust the cache', function () { @@ -84,6 +88,9 @@ $mock = AutoloadManager::partialMock(); $mock->run(); - expect(array_values($mock->getRegisteredProviders()))->toEqualCanonicalizing($this->providers); + $expected = array_values($this->providers); + $registered = array_values($mock->getRegisteredProviders()); + expect($registered)->toHaveCount(count($expected)); + expect($registered)->each(fn ($item) => $item->toBeIn($expected)); }); });