Fix CI test suite#66
Merged
Merged
Conversation
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
marked this pull request as draft
June 23, 2026 20:06
rtlechow
marked this pull request as ready for review
June 23, 2026 20:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/Factory/IncidentFactory.php;GamesControllerTestreferences
IncidentFactory::make()but the file was never committed,causing a fatal "Class not found" error
tests/bootstrap.phpsoRouter::url(..., true)produces a validabsolute URL under the CLI SAPI: set
HTTP_HOSTbeforeconfig/bootstrap.phpruns, rather than after (when the empty Router basehttp://had already been cached)/instead of/users/loginbecauseparse_url('http:///users/login')returns false,which the Authentication plugin falls back from to
/'on'for$_SERVER['HTTPS']instead of the integer1,which the bundled Diactoros version rejects
fullBaseUrlwas already set by the time its condition was checked) and the now-unused
Routerimport