cleanup(); } protected function tearDown(): void { $this->cleanup(); parent::tearDown(); } private function cleanup(): void { @unlink(BASE_PATH . '/storage/app/g7_installed'); @unlink(BASE_PATH . '/.env'); } public function test_no_signals_means_not_completed(): void { $this->assertFalse(installer_is_completed()); } public function test_lock_file_only_marks_completed(): void { file_put_contents(BASE_PATH . '/storage/app/g7_installed', ''); $this->assertTrue(installer_is_completed()); } public function test_env_flag_only_marks_completed(): void { file_put_contents(BASE_PATH . '/.env', "APP_ENV=local\nINSTALLER_COMPLETED=true\n"); $this->assertTrue(installer_is_completed()); } public function test_env_flag_accepts_quoted_true(): void { file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED="true"' . "\n"); $this->assertTrue(installer_is_completed()); } public function test_env_flag_accepts_one(): void { file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED=1' . "\n"); $this->assertTrue(installer_is_completed()); } public function test_env_flag_false_does_not_mark_completed(): void { file_put_contents(BASE_PATH . '/.env', "APP_ENV=local\nINSTALLER_COMPLETED=false\n"); $this->assertFalse(installer_is_completed()); } public function test_env_flag_missing_does_not_mark_completed(): void { file_put_contents(BASE_PATH . '/.env', "APP_ENV=local\n"); $this->assertFalse(installer_is_completed()); } public function test_both_signals_present_marks_completed(): void { file_put_contents(BASE_PATH . '/storage/app/g7_installed', ''); file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED=true' . "\n"); $this->assertTrue(installer_is_completed()); } }