Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make json assertions stricter #2241

Conversation

Sazpaimon
Copy link

This is #1629 rebased onto the latest master as I ran into the same issues that @kalenp did. I'm hoping no additional work would be required but if so let me know.

kalenp added 2 commits July 12, 2016 17:47
assertJsonStringEqualsJsonString and assertJsonStringNotEqualsJsonString
didn't use the same JsonMatches constraint as the other json assertions.
Update them to use the same constraint so its implementation can be
consistently updated.
The JsonMatches constraint considered the following strings equal.
{ "number": 5 }
{ "number": "5" }

These are different objects in JSON, because the values have different
basic types.  Change from using a simple (==) comparison of objects in
PHP to a strategy where the JSON is canonicalized and then the
reformatted strings are compared.
@sebastianbergmann
Copy link
Owner

Merged manually, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants