Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Nov 17, 2024
1 parent 93c617b commit 6ed4472
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions tests/Autoload/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
});

Expand All @@ -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 () {
Expand All @@ -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));
});
});
13 changes: 10 additions & 3 deletions tests/Autoload/ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
});

Expand All @@ -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 () {
Expand All @@ -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));
});
});

0 comments on commit 6ed4472

Please sign in to comment.