1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 06:54:03 +00:00

Test that when a tenant doesn't have the property that should be mapped to config, the central config values are kept

This commit is contained in:
lukinovec 2026-07-12 12:28:01 +02:00
parent 120cec440b
commit 12e51d0378

View file

@ -152,6 +152,13 @@ test('BroadcastingConfigBootstrapper maps tenant properties to broadcaster crede
expect(app(BroadcasterContract::class)->config['key'])->toBe('tenant1_key'); expect(app(BroadcasterContract::class)->config['key'])->toBe('tenant1_key');
expect(Broadcast::driver()->config['key'])->toBe('tenant1_key'); expect(Broadcast::driver()->config['key'])->toBe('tenant1_key');
// Initializing tenancy for a tenant without the mapped property keeps the central config value
tenancy()->initialize(Tenant::create());
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');
tenancy()->end(); tenancy()->end();
expect(config("broadcasting.connections.{$driver}.key"))->toBe('central_key'); expect(config("broadcasting.connections.{$driver}.key"))->toBe('central_key');