From aedb33bb3a23c442a1296749d8e5a46cd507ac04 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Mon, 13 Apr 2026 12:45:53 +0200 Subject: [PATCH] Clean up log files in before/afterEach --- tests/Bootstrappers/LogTenancyBootstrapperTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Bootstrappers/LogTenancyBootstrapperTest.php b/tests/Bootstrappers/LogTenancyBootstrapperTest.php index 5900beb2..45ef9e79 100644 --- a/tests/Bootstrappers/LogTenancyBootstrapperTest.php +++ b/tests/Bootstrappers/LogTenancyBootstrapperTest.php @@ -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 () {