mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 09:54:03 +00:00
Test configuring BroadcastingConfigBootstrapper::$broadcaster
This commit is contained in:
parent
e6c4c317fe
commit
4422df2e04
1 changed files with 18 additions and 0 deletions
|
|
@ -344,3 +344,21 @@ test('initializing tenancy does not fail when the broadcaster does not extend th
|
|||
->toBeInstanceOf(get_class($contractBroadcaster))
|
||||
->not()->toBe($centralBroadcaster);
|
||||
});
|
||||
|
||||
test('setting the broadcaster property overrides which map preset is used', function () {
|
||||
config([
|
||||
'tenancy.bootstrappers' => [BroadcastingConfigBootstrapper::class],
|
||||
'broadcasting.default' => 'testing',
|
||||
'broadcasting.connections.testing.driver' => 'testing',
|
||||
'broadcasting.connections.pusher.key' => 'central_key',
|
||||
]);
|
||||
|
||||
app(BroadcastManager::class)->extend('testing', fn () => new TestingBroadcaster('testing'));
|
||||
|
||||
// Use the pusher preset even though the default connection isn't pusher
|
||||
BroadcastingConfigBootstrapper::$broadcaster = 'pusher';
|
||||
|
||||
tenancy()->initialize(Tenant::create(['pusher_key' => 'tenant_key']));
|
||||
|
||||
expect(config('broadcasting.connections.pusher.key'))->toBe('tenant_key');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue