Skip to content

Fix CI test suite#66

Merged
Zuluru merged 2 commits into
Zuluru:masterfrom
rtlechow:fix-ci-test-suite
Jun 23, 2026
Merged

Fix CI test suite#66
Zuluru merged 2 commits into
Zuluru:masterfrom
rtlechow:fix-ci-test-suite

Conversation

@rtlechow

@rtlechow rtlechow commented Jun 23, 2026

Copy link
Copy Markdown
Contributor
  • Add the missing tests/Factory/IncidentFactory.php; GamesControllerTest
    references IncidentFactory::make() but the file was never committed,
    causing a fatal "Class not found" error
  • Fix tests/bootstrap.php so Router::url(..., true) produces a valid
    absolute URL under the CLI SAPI: set HTTP_HOST before
    config/bootstrap.php runs, rather than after (when the empty Router base
    http:// had already been cached)
  • Without this, unauthenticated redirects resolved to / instead of
    /users/login because parse_url('http:///users/login') returns false,
    which the Authentication plugin falls back from to /
  • Use the string 'on' for $_SERVER['HTTPS'] instead of the integer 1,
    which the bundled Diactoros version rejects
  • Remove the previous gated fix attempt (it never ran because fullBaseUrl
    was already set by the time its condition was checked) and the now-unused
    Router import

rtlechow added 2 commits June 23, 2026 16:04
GamesControllerTest references IncidentFactory but the factory file was
never committed, causing a fatal "Class not found" error in the suite.
Under the CLI SAPI there is no HTTP_HOST, so config/bootstrap.php computed
an empty Router base ('http://'). Router::url(..., true) then produced
malformed URLs like 'http:///users/login', which parse_url() rejects, so
the Authentication plugin collapsed unauthenticated redirects to '/'. Set
the host before bootstrapping, and use a string for HTTPS (Diactoros
rejects the integer).
@rtlechow
rtlechow marked this pull request as draft June 23, 2026 20:06
@rtlechow
rtlechow marked this pull request as ready for review June 23, 2026 20:18
@Zuluru
Zuluru merged commit 573962e into Zuluru:master Jun 23, 2026
1 check passed
@rtlechow
rtlechow deleted the fix-ci-test-suite branch June 23, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants