-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Arrays with different keys and the same values are considered equal in canonicalize mode #112
Labels
Comments
mgleska
added a commit
to mgleska/phpunit-comparator
that referenced
this issue
Aug 11, 2024
Proposed solution in PR #113 |
sebastianbergmann
changed the title
Arrays with different keys and the same values are recognized as equals in canonicalize mode
Arrays with different keys and the same values are considered equal in canonicalize mode
Aug 12, 2024
sebastianbergmann
pushed a commit
that referenced
this issue
Aug 12, 2024
This doesn't seem backwards-compatible at all. Even though it may be considered "wrong" to only compare values, ignoring keys, some of my tests were relying on this behaviour, so I'm not sure why this was released with a minor version bump. |
It is a breaking change because it's even throwing with int keys: sebastianbergmann/phpunit#5967 (comment) |
sebastianbergmann
added a commit
that referenced
this issue
Oct 18, 2024
This reverts commit b021fdb.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Consider following arrays:
['a' => 1 , 'b' => 2]
and['c' => 1, 'd' => 2]
Comparing these arrays in canonicalize mode do not throw
ComparisonFailure
exception.How to reproduce
Current response
Expected response
Both tests passing with success.
The text was updated successfully, but these errors were encountered: