From 7142bb608a472b4f9299c7b00a1ab5f7f221cfc6 Mon Sep 17 00:00:00 2001 From: Friederich Loheide Date: Mon, 28 Sep 2026 14:57:36 +0000 Subject: [PATCH] =?UTF-8?q?Tests:=20Wartungsmodus=20je=20Test=20in=20tempo?= =?UTF-8?q?r=C3=A4rem=20Pfad,=20storage/.maintenance-*=20ignorieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitignore | 1 + storage/.maintenance-last | 1 - tests/TestCase.php | 9 +++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) delete mode 100644 storage/.maintenance-last diff --git a/.gitignore b/.gitignore index c6bac7dc..cc33122d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ /storage/.version /storage/.update-progress /storage/.maintenance +/storage/.maintenance-* # Laufzeitzustand der Installation – nie ausliefern (ein manuelles Update würde sonst fällige Migrationen überspringen) /storage/.migrations-fingerprint /storage/.background-heartbeat diff --git a/storage/.maintenance-last b/storage/.maintenance-last deleted file mode 100644 index c7c2ae26..00000000 --- a/storage/.maintenance-last +++ /dev/null @@ -1 +0,0 @@ -{"since":1790606319,"until":1790606319} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 69a8da89..30c697d5 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,6 +3,7 @@ namespace Tests; use App\Plugins\PluginState; +use App\Support\Update\MaintenanceFlag; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Illuminate\Testing\TestResponse; @@ -16,6 +17,14 @@ abstract class TestCase extends BaseTestCase return parent::createApplication(); } + protected function setUp(): void + { + parent::setUp(); + + // Wartungsmodus und Update-Zeiträume nie im echten storage/ – und je Test frisch + $this->app->instance(MaintenanceFlag::class, new MaintenanceFlag(sys_get_temp_dir().'/inhaus-test-'.bin2hex(random_bytes(4)).'.maintenance')); + } + /** * Props einer Startseiten-Kachel (oder null, wenn sie nicht angezeigt wird). *