mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 07:54:03 +00:00
Delete redundant second tenant from auth prop copying test
One tenant is enough to test context isolation
This commit is contained in:
parent
d69c9f0a85
commit
4e9f8a3c3e
1 changed files with 2 additions and 10 deletions
|
|
@ -221,8 +221,7 @@ test('tenant broadcasters receive the auth properties of the broadcaster bound i
|
||||||
'broadcasting.connections.testing.driver' => 'testing',
|
'broadcasting.connections.testing.driver' => 'testing',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$tenant1 = Tenant::create();
|
$tenant = Tenant::create();
|
||||||
$tenant2 = Tenant::create();
|
|
||||||
|
|
||||||
app(BroadcastManager::class)->extend('testing', fn () => new TestingBroadcaster('testing'));
|
app(BroadcastManager::class)->extend('testing', fn () => new TestingBroadcaster('testing'));
|
||||||
$getCurrentChannelsFromBoundBroadcaster = fn () => array_keys(invade(app(BroadcasterContract::class))->channels);
|
$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());
|
->toBeIn($getCurrentChannelsFromBoundBroadcaster());
|
||||||
expect($resolveUser())->toBe(['id' => 'central-user']);
|
expect($resolveUser())->toBe(['id' => 'central-user']);
|
||||||
|
|
||||||
tenancy()->initialize($tenant1);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
expect($channel)
|
expect($channel)
|
||||||
->toBeIn($getCurrentChannelsThroughManager())
|
->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(invade(app(BroadcasterContract::class))->retrieveChannelOptions($channel))->toBe($options);
|
||||||
expect($resolveUser())->toBe(['id' => 'central-user']);
|
expect($resolveUser())->toBe(['id' => 'central-user']);
|
||||||
|
|
||||||
tenancy()->initialize($tenant2);
|
|
||||||
|
|
||||||
expect($channel)
|
|
||||||
->toBeIn($getCurrentChannelsThroughManager())
|
|
||||||
->toBeIn($getCurrentChannelsFromBoundBroadcaster());
|
|
||||||
expect($resolveUser())->toBe(['id' => 'central-user']);
|
|
||||||
|
|
||||||
tenancy()->end();
|
tenancy()->end();
|
||||||
|
|
||||||
expect($channel)
|
expect($channel)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue