mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 22:54:03 +00:00
Clean up global state (static properties) in before/afterEach
This commit is contained in:
parent
52d10d36f9
commit
53b2181779
5 changed files with 30 additions and 5 deletions
|
|
@ -13,12 +13,17 @@ use Stancl\Tenancy\Tests\Etc\TestingBroadcaster;
|
|||
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
||||
use Illuminate\Contracts\Broadcasting\Broadcaster as BroadcasterContract;
|
||||
|
||||
beforeEach(function() {
|
||||
beforeEach(function () {
|
||||
withTenantDatabases();
|
||||
TenancyBroadcastManager::$tenantBroadcasters = ['pusher', 'ably'];
|
||||
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
||||
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
TenancyBroadcastManager::$tenantBroadcasters = ['pusher', 'ably'];
|
||||
});
|
||||
|
||||
test('bound broadcaster instance is the same before initializing tenancy and after ending it', function() {
|
||||
config(['broadcasting.default' => 'null']);
|
||||
TenancyBroadcastManager::$tenantBroadcasters[] = 'null';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue