Increase test coverage by 8.5% (63.88% → 72.41% lines)#19
Merged
Conversation
… to 72.41% (+8.53%) Agent-Logs-Url: https://github.com/voku/httpful/sessions/652cd0c8-9cd7-4640-8479-963993224108 Co-authored-by: voku <264695+voku@users.noreply.github.com>
…rename $e to $error Agent-Logs-Url: https://github.com/voku/httpful/sessions/652cd0c8-9cd7-4640-8479-963993224108 Co-authored-by: voku <264695+voku@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
voku
April 23, 2026 22:51
View session
Apply fixes from StyleCI
Copilot AI
added a commit
that referenced
this pull request
Apr 24, 2026
Agent-Logs-Url: https://github.com/voku/httpful/sessions/38f2586c-2ab7-460d-a78b-d8b321aa49c0 Co-authored-by: voku <264695+voku@users.noreply.github.com>
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.
Test coverage was at 63.88% line coverage with several core classes having 0% method coverage. Added 97 new tests across previously undertested areas, raising line coverage to 72.41% (+8.53%).
New test file:
tests/Httpful/CoverageBoostTest.phpClasses covered
UriResolverClientErrorExceptionFactoryFormMimeHandlerHtmlMimeHandlerXmlMimeHandlerCsvMimeHandlerHttpMimeRequestSetupRegressions caught
The new tests exercise edge cases that validate existing error-handling contracts:
Http::reason(999)→ throwsResponseExceptionfor unknown status codesRequest::enableKeepAlive(0)/enableKeepAlive(-1)→ throwsInvalidArgumentExceptionXmlMimeHandler::parse('not valid xml')→ throwsXmlParseException(requiresLIBXML_NOERROR|LIBXML_NOWARNINGto prevent PHPUnit'sconvertWarningsToExceptionsfrom intercepting the libxml warning before the handler can throw)Factory::createStreamFromFile('/nonexistent', 'rb')→ throwsRuntimeExceptionFactory::createStreamFromFile('...', 'z')→ throwsInvalidArgumentExceptionfor invalid modeHttp::stream(new \stdClass())→ throwsInvalidArgumentExceptionfor unsupported object typeThis change is