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

Delete redundant second tenant from auth prop copying test

One tenant is enough to test context isolation
This commit is contained in:
lukinovec 2026-07-21 11:03:35 +02:00
parent d69c9f0a85
commit 4e9f8a3c3e

View file

@ -221,8 +221,7 @@ test('tenant broadcasters receive the auth properties of the broadcaster bound i
'broadcasting.connections.testing.driver' => 'testing',
]);
$tenant1 = Tenant::create();
$tenant2 = Tenant::create();
$tenant = Tenant::create();
app(BroadcastManager::class)->extend('testing', fn () => new TestingBroadcaster('testing'));
$getCurrentChannelsFromBoundBroadcaster = fn () => array_keys(invade(app(BroadcasterContract::class))->channels);
@ -242,7 +241,7 @@ test('tenant broadcasters receive the auth properties of the broadcaster bound i
->toBeIn($getCurrentChannelsFromBoundBroadcaster());
expect($resolveUser())->toBe(['id' => 'central-user']);
tenancy()->initialize($tenant1);
tenancy()->initialize($tenant);
expect($channel)
->toBeIn($getCurrentChannelsThroughManager())
@ -254,13 +253,6 @@ test('tenant broadcasters receive the auth properties of the broadcaster bound i
expect(invade(app(BroadcasterContract::class))->retrieveChannelOptions($channel))->toBe($options);
expect($resolveUser())->toBe(['id' => 'central-user']);
tenancy()->initialize($tenant2);
expect($channel)
->toBeIn($getCurrentChannelsThroughManager())
->toBeIn($getCurrentChannelsFromBoundBroadcaster());
expect($resolveUser())->toBe(['id' => 'central-user']);
tenancy()->end();
expect($channel)