v7.0.0-beta.6 release
This commit is contained in:
1 parent
cc45c0b84c
commit
61f5874fd2
51 files changed
+4151
-106
No files matched your search
@@ -65,6 +65,52 @@ class EnvironmentDetectorTest extends TestCase
|
||||
$this->assertSame($hint, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* stat 가드 완화 회귀 — 시놀로지 DSM 등 open_basedir 환경에서 정상 절대경로
|
||||
* 가 false negative 로 거부되지 않고 hint/config 후보로 채택되어야 함.
|
||||
* 실제 실행 가능 여부는 canExecuteComposer 의 proc_open 결과로 최종 판정.
|
||||
*/
|
||||
public function test_find_composer_binary_accepts_safe_absolute_path_hint_without_stat(): void
|
||||
{
|
||||
$detector = new EnvironmentDetector;
|
||||
$detector->resetCache();
|
||||
|
||||
// 실제로 존재하지 않는 경로지만 메타문자 없음 — stat 가드 제거로 채택됨
|
||||
$hint = '/usr/local/bin/composer';
|
||||
$result = $detector->findComposerBinary($hint);
|
||||
|
||||
$this->assertSame($hint, $result);
|
||||
}
|
||||
|
||||
public function test_find_composer_binary_rejects_single_token_hint_with_shell_metachars(): void
|
||||
{
|
||||
$detector = new EnvironmentDetector;
|
||||
$detector->resetCache();
|
||||
|
||||
$original = config('process.composer_binary');
|
||||
config(['process.composer_binary' => null]);
|
||||
|
||||
try {
|
||||
// 단일 토큰(공백 없음) 셸 메타문자 hint 는 isExecutableCandidate 가 거부.
|
||||
// 공백 포함 hint 는 .env 값을 신뢰하는 운영자 자기 책임 영역이라 별도 분기.
|
||||
foreach ([
|
||||
'/bin/composer;id',
|
||||
'/bin/composer$(id)',
|
||||
'`/bin/composer`',
|
||||
'/bin/composer|nc',
|
||||
'/bin/composer&id',
|
||||
] as $payload) {
|
||||
$detector->resetCache();
|
||||
$result = $detector->findComposerBinary($payload);
|
||||
|
||||
// 메타문자 hint 는 절대 채택되지 않음 — 결과는 PATH 검색 결과 또는 null
|
||||
$this->assertNotSame($payload, $result, "메타문자 hint 거부: {$payload}");
|
||||
}
|
||||
} finally {
|
||||
config(['process.composer_binary' => $original]);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_summarize_returns_complete_report(): void
|
||||
{
|
||||
$report = $this->detector->summarize();
|
||||
|
||||
Reference in new issue
Block a user