mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-07 00:24:03 +00:00
Use toEqualCanonicalizing instead of toBe for custom creators
The order of the array items shouldn't matter.
This commit is contained in:
parent
7db486d1b9
commit
d885659a16
1 changed files with 3 additions and 3 deletions
|
|
@ -171,19 +171,19 @@ test('tenant broadcast manager receives the custom driver creators of the centra
|
||||||
);
|
);
|
||||||
|
|
||||||
// Current BroadcastManager instance has the original custom creators plus the newly registered testing-tenant1 creator
|
// Current BroadcastManager instance has the original custom creators plus the newly registered testing-tenant1 creator
|
||||||
expect(array_keys(invade(app(BroadcastManager::class))->customCreators))->toBe([...$originalDrivers, 'testing-tenant1']);
|
expect(array_keys(invade(app(BroadcastManager::class))->customCreators))->toEqualCanonicalizing([...$originalDrivers, 'testing-tenant1']);
|
||||||
|
|
||||||
tenancy()->initialize($tenant2);
|
tenancy()->initialize($tenant2);
|
||||||
|
|
||||||
// Current BroadcastManager only has the original custom creators,
|
// Current BroadcastManager only has the original custom creators,
|
||||||
// the creator added in the previous tenant's context doesn't persist.
|
// the creator added in the previous tenant's context doesn't persist.
|
||||||
expect(array_keys(invade(app(BroadcastManager::class))->customCreators))->toBe($originalDrivers);
|
expect(array_keys(invade(app(BroadcastManager::class))->customCreators))->toEqualCanonicalizing($originalDrivers);
|
||||||
|
|
||||||
tenancy()->end();
|
tenancy()->end();
|
||||||
|
|
||||||
// Ending tenancy reverts the BroadcastManager binding back to the original state,
|
// Ending tenancy reverts the BroadcastManager binding back to the original state,
|
||||||
// the creator registered in the tenant context doesn't persist.
|
// the creator registered in the tenant context doesn't persist.
|
||||||
expect(array_keys(invade(app(BroadcastManager::class))->customCreators))->toBe($originalDrivers);
|
expect(array_keys(invade(app(BroadcastManager::class))->customCreators))->toEqualCanonicalizing($originalDrivers);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('tenant broadcasters receive the channels from the broadcaster bound in central context', function(string $driver) {
|
test('tenant broadcasters receive the channels from the broadcaster bound in central context', function(string $driver) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue