Skip to content

Commit 00c740e

Browse files
committed
test(envlite): use truly invalid cached port in phase1 test
The fixture used 9999, which falls inside the 1..65535 range that envlite_phase1_discover_port treats as a valid cached port — so the function returned 9999 and the assertion that the port came from the 8100..8899 auto-discovery pool would have failed if the suite ever got that far. Use 70000 so the cache-out-of-range path is actually exercised.
1 parent dae7595 commit 00c740e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tools/local-env/tests/test_phase1.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ function test_phase1_uses_cached_port_when_in_range() {
4545
function test_phase1_ignores_cache_when_out_of_range() {
4646
$dir = envlite_test_tmpdir('phase1-bad-cache');
4747
mkdir($dir . '/.envlite');
48-
file_put_contents($dir . '/.envlite/port', "9999\n");
48+
// 70000 is outside the 1..65535 cached-port acceptance window, so the
49+
// cache must be ignored and a fresh port picked from the auto pool.
50+
file_put_contents($dir . '/.envlite/port', "70000\n");
4951
$port = envlite_phase1_discover_port($dir, null);
5052
envlite_assert($port >= 8100 && $port <= 8899);
5153
}

0 commit comments

Comments
 (0)