mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 12:04:04 +00:00
Test reverting to central credentials after a tenant with overrides
The existing assertions only ran after a tenant without credential overrides, so a tenant broadcaster leaking into central context could hold the central key anyway and go unnoticed (works as a regression for the forgetDrivers() refactor)
This commit is contained in:
parent
44b97ae096
commit
9efebf964c
1 changed files with 8 additions and 0 deletions
|
|
@ -152,6 +152,14 @@ test('BroadcastingConfigBootstrapper maps tenant properties to broadcaster crede
|
|||
expect(app(BroadcasterContract::class)->config['key'])->toBe('tenant1_key');
|
||||
expect(Broadcast::driver()->config['key'])->toBe('tenant1_key');
|
||||
|
||||
// Ending tenancy after a tenant overrode the credentials reverts the broadcasters back to the central credentials
|
||||
tenancy()->end();
|
||||
|
||||
expect(config("broadcasting.connections.{$driver}.key"))->toBe('central_key');
|
||||
expect(app(BroadcastManager::class)->driver()->config['key'])->toBe('central_key');
|
||||
expect(app(BroadcasterContract::class)->config['key'])->toBe('central_key');
|
||||
expect(Broadcast::driver()->config['key'])->toBe('central_key');
|
||||
|
||||
// Initializing tenancy for a tenant without the mapped property keeps the central config value
|
||||
tenancy()->initialize(Tenant::create());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue