mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-07 07:54:04 +00:00
Clean up log files in before/afterEach
This commit is contained in:
parent
39fc72bea5
commit
aedb33bb3a
1 changed files with 12 additions and 0 deletions
|
|
@ -19,6 +19,12 @@ beforeEach(function () {
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@unlink(storage_path('logs/laravel.log'));
|
||||||
|
@unlink(storage_path('logs/laravel-' . now()->format('Y-m-d') . '.log'));
|
||||||
|
foreach (glob(storage_path('tenant*/logs/*.log')) ?: [] as $path) {
|
||||||
|
@unlink($path);
|
||||||
|
}
|
||||||
|
|
||||||
// Reset static properties
|
// Reset static properties
|
||||||
LogTenancyBootstrapper::$channelOverrides = [];
|
LogTenancyBootstrapper::$channelOverrides = [];
|
||||||
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
|
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
|
||||||
|
|
@ -30,6 +36,12 @@ beforeEach(function () {
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
LogTenancyBootstrapper::$channelOverrides = [];
|
LogTenancyBootstrapper::$channelOverrides = [];
|
||||||
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
|
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
|
||||||
|
|
||||||
|
@unlink(storage_path('logs/laravel.log'));
|
||||||
|
@unlink(storage_path('logs/laravel-' . now()->format('Y-m-d') . '.log'));
|
||||||
|
foreach (glob(storage_path('tenant*/logs/*.log')) ?: [] as $path) {
|
||||||
|
@unlink($path);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('storage path channels get tenant-specific paths by default', function () {
|
test('storage path channels get tenant-specific paths by default', function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue