mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 04:54:04 +00:00
Improve channel closure inheritance test
Originally, the test only asserted that the broadcasters inherited the correct channel names. Now, the test also asserts that the actual closure and the channel options are inherited too.
This commit is contained in:
parent
12e51d0378
commit
0ba588d299
1 changed files with 5 additions and 1 deletions
|
|
@ -226,7 +226,7 @@ test('tenant broadcasters receive the channels from the broadcaster bound in cen
|
|||
$getCurrentChannelsFromBoundBroadcaster = fn () => array_keys(invade(app(BroadcasterContract::class))->channels);
|
||||
$getCurrentChannelsThroughManager = fn () => array_keys(invade(app(BroadcastManager::class)->driver())->channels);
|
||||
|
||||
Broadcast::channel($channel = 'testing-channel', fn () => true);
|
||||
Broadcast::channel($channel = 'testing-channel', $callback = fn () => true, $options = ['guards' => ['web']]);
|
||||
|
||||
expect($channel)
|
||||
->toBeIn($getCurrentChannelsThroughManager())
|
||||
|
|
@ -238,6 +238,10 @@ test('tenant broadcasters receive the channels from the broadcaster bound in cen
|
|||
->toBeIn($getCurrentChannelsThroughManager())
|
||||
->toBeIn($getCurrentChannelsFromBoundBroadcaster());
|
||||
|
||||
// The channel auth closure and the channel options are copied to the tenant broadcaster as-is
|
||||
expect(invade(app(BroadcasterContract::class))->channels[$channel])->toBe($callback);
|
||||
expect(invade(app(BroadcasterContract::class))->retrieveChannelOptions($channel))->toBe($options);
|
||||
|
||||
tenancy()->initialize($tenant2);
|
||||
|
||||
expect($channel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue