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

Clean up log files in before/afterEach

This commit is contained in:
lukinovec 2026-04-13 12:45:53 +02:00
parent 39fc72bea5
commit aedb33bb3a

View file

@ -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
LogTenancyBootstrapper::$channelOverrides = [];
LogTenancyBootstrapper::$storagePathChannels = ['single', 'daily'];
@ -30,6 +36,12 @@ beforeEach(function () {
afterEach(function () {
LogTenancyBootstrapper::$channelOverrides = [];
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 () {