Repository navigation
Make the serializer tests independent of the PHP 8.6 JSON error text - #176
Merged
Merged
Conversation
PHP 8.6 appends the position to JSON error messages ("Syntax error near
location 1:12"). The library only passes that text through and uses the
JSON_ERROR_* code; the tests now take the expected text from the running
PHP. UPGRADE-6.0.md notes that the text depends on the PHP version.
Coverage Report for CI Build 40215322223Coverage remained the same at 99.283%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
PHP 8.6 appends the position to JSON error messages:
Syntax errorbecameSyntax error near location 1:12. TwoMessageSerializerTesttests compared the exact text, so the PHP 8.6 job failed.Audit
src/does not depend on the text.MessageSerializeronly passesJsonException::getMessage()through into theSerializeExceptionmessage and sets theJSON_ERROR_*code as the exception code. No logic compares messages.php:8.6-rc-cli,failOnDeprecation/failOnNotice,error_reporting=-1): after this change the only failures came from extensions missing in the local image (redis, pcntl). There were no deprecations, notices or other 8.6 failures. The full run with every extension and broker is the CI PHP 8.6 job.composer.jsonphpconstraint does not block 8.6.Changes
jsonError()helper), and the exact assertions stay in place.testInvalidJsonKeepsTheJsonExceptionAsPreviousalso asserts theinvalid JSON (Syntax errorprefix next to theJSON_ERROR_SYNTAXcode.invalid JSONdepends on the PHP version, and that code should match theJSON_ERROR_*code instead. The EN and SK docs only show<error>, so they need no change.continue-on-errorbecause 8.6 is not GA yet.Review log
<error>), the CHANGELOG placement and the commit metadata. Found nothing.Verification
MessageSerializerTestpasses on PHP 8.4.26 and 8.6.0RC4 (it failed on 8.6 before this change)src/changes, so Infection has no changed lines to mutate (CI Infection job)