mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 05:54:03 +00:00
Test that ending tenancy forgets the stack channels properly
This commit is contained in:
parent
68e6fd6c02
commit
a6ce0e2b88
1 changed files with 16 additions and 4 deletions
|
|
@ -367,8 +367,8 @@ test('stack channels that include any configured channel are re-resolved', funct
|
||||||
|
|
||||||
// Resolve the stack channel in the central context first
|
// Resolve the stack channel in the central context first
|
||||||
// (this caches the stack with its members still pointing at the central logs).
|
// (this caches the stack with its members still pointing at the central logs).
|
||||||
Log::channel('custom_stack')->info('central');
|
Log::channel('custom_stack')->info('central log message');
|
||||||
expect(file_get_contents($centralLogPath))->toContain('central');
|
expect(file_get_contents($centralLogPath))->toContain('central log message');
|
||||||
|
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
|
|
@ -379,14 +379,26 @@ test('stack channels that include any configured channel are re-resolved', funct
|
||||||
// so 'tenant log message' should be logged to the tenant log,
|
// so 'tenant log message' should be logged to the tenant log,
|
||||||
// not the central log.
|
// not the central log.
|
||||||
expect(file_get_contents($centralLogPath))
|
expect(file_get_contents($centralLogPath))
|
||||||
->toContain('central')
|
->toContain('central log message')
|
||||||
->not()->toContain('tenant log message');
|
->not()->toContain('tenant log message');
|
||||||
|
|
||||||
$tenantLogPath = storage_path('logs/laravel.log');
|
$tenantLogPath = storage_path('logs/laravel.log');
|
||||||
|
|
||||||
expect(file_exists($tenantLogPath))->toBeTrue();
|
expect(file_exists($tenantLogPath))->toBeTrue();
|
||||||
expect(file_get_contents($tenantLogPath))
|
expect(file_get_contents($tenantLogPath))
|
||||||
->toContain('tenant log message');
|
->toContain('tenant log message');
|
||||||
|
|
||||||
|
tenancy()->end();
|
||||||
|
|
||||||
|
Log::channel('custom_stack')->info('central after revert');
|
||||||
|
|
||||||
|
expect(file_get_contents($centralLogPath))
|
||||||
|
->toContain('central log message')
|
||||||
|
->toContain('central after revert')
|
||||||
|
->not()->toContain('tenant log message');
|
||||||
|
|
||||||
|
expect(file_get_contents($tenantLogPath))
|
||||||
|
->toContain('tenant log message')
|
||||||
|
->not()->toContain('central after revert');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('slack channel uses correct webhook urls', function () {
|
test('slack channel uses correct webhook urls', function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue