From 0ba588d2997c835ea3a591c8f1071256c7b119fd Mon Sep 17 00:00:00 2001 From: lukinovec Date: Sun, 12 Jul 2026 12:34:42 +0200 Subject: [PATCH] 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. --- tests/Bootstrappers/BroadcastingConfigBootstrapperTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Bootstrappers/BroadcastingConfigBootstrapperTest.php b/tests/Bootstrappers/BroadcastingConfigBootstrapperTest.php index 1ea35d66..f2a06065 100644 --- a/tests/Bootstrappers/BroadcastingConfigBootstrapperTest.php +++ b/tests/Bootstrappers/BroadcastingConfigBootstrapperTest.php @@ -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)