v7.0.0-beta.7 release

This commit is contained in:
HeuJung committed 2026-05-15 19:24:41 +09:00
1 parent c186d9a9c2
commit 0e7fa04b03
36 files changed
+2625 -83

No files matched your search

+69 -2
View File
@@ -57,8 +57,14 @@ class InstallerGuardTest extends TestCase
private function cleanup(): void
{
@unlink(BASE_PATH . '/storage/app/g7_installed');
@unlink(BASE_PATH . '/.env');
$lock = BASE_PATH . '/storage/app/g7_installed';
if (is_file($lock)) {
@unlink($lock);
}
$env = BASE_PATH . '/.env';
if (is_file($env)) {
@unlink($env);
}
}
public function test_no_signals_means_not_completed(): void
@@ -115,4 +121,65 @@ class InstallerGuardTest extends TestCase
$this->assertTrue(installer_is_completed());
}
// ------------------------------------------------------------------------
// finalize 전용 가드 — installer_finalize_is_completed()
//
// 일반 가드와 달리 g7_installed 락 파일은 차단 사유에서 제외되어야 한다
// (complete_flag task 가 락 파일을 먼저 생성한 직후 finalize 가 호출되는
// 설계상의 호출 순서 때문 — 이슈 #371 자가 차단 회귀 가드).
// ------------------------------------------------------------------------
public function test_finalize_guard_passes_with_lock_only(): void
{
// 정상 1회차 finalize 시나리오: 락 파일은 존재하나 .env 머지 아직 안 됨
file_put_contents(BASE_PATH . '/storage/app/g7_installed', '');
$this->assertFalse(
installer_finalize_is_completed(),
'g7_installed 락 파일 단독 존재 시 finalize 차단되면 자가 차단 회귀 (이슈 #371)'
);
}
public function test_finalize_guard_passes_with_no_env_file(): void
{
// .env 자체가 없는 신규 설치 시나리오
$this->assertFalse(installer_finalize_is_completed());
}
public function test_finalize_guard_blocks_when_env_completed_true(): void
{
// 이미 finalize 된 상태 — 멱등 차단
file_put_contents(BASE_PATH . '/.env', "APP_ENV=local\nINSTALLER_COMPLETED=true\n");
$this->assertTrue(installer_finalize_is_completed());
}
public function test_finalize_guard_blocks_with_lock_and_env_completed(): void
{
// 락 + .env true 동시 존재 → 차단 (멱등)
file_put_contents(BASE_PATH . '/storage/app/g7_installed', '');
file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED=true' . "\n");
$this->assertTrue(installer_finalize_is_completed());
}
public function test_finalize_guard_passes_when_env_completed_false(): void
{
file_put_contents(BASE_PATH . '/.env', "INSTALLER_COMPLETED=false\n");
$this->assertFalse(installer_finalize_is_completed());
}
public function test_finalize_guard_accepts_quoted_and_alt_truthy_values(): void
{
file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED="true"' . "\n");
$this->assertTrue(installer_finalize_is_completed());
file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED=1' . "\n");
$this->assertTrue(installer_finalize_is_completed());
file_put_contents(BASE_PATH . '/.env', 'INSTALLER_COMPLETED=yes' . "\n");
$this->assertTrue(installer_finalize_is_completed());
}
}
@@ -73,9 +73,13 @@ class InstallerSecurityHardeningTest extends TestCase
*/
protected function tearDown(): void
{
@unlink(STATE_PATH);
if (is_file(STATE_PATH)) {
@unlink(STATE_PATH);
}
$projectStateFile = dirname(__DIR__, 3) . '/storage/installer-state.json';
@unlink($projectStateFile);
if (is_file($projectStateFile)) {
@unlink($projectStateFile);
}
parent::tearDown();
}
@@ -366,7 +370,7 @@ class InstallerSecurityHardeningTest extends TestCase
'/opt/php/bin/php',
'C:/php/php.exe',
'/nonexistent/path',
// Windows 절대경로 (백슬래시 포함) — 회귀 가드: PO 환경 (Windows 빌트인 서버)
// Windows 절대경로 (백슬래시 포함) — 회귀 가드: Windows 빌트인 서버 환경
'C:\\laragon\\bin\\php\\php-8.3.26-Win32-vs16-x64\\php.exe',
'C:\\php\\php.exe',
'D:\\xampp\\php\\php.exe',