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). *