You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the JSON spec outlined at json.org, an object (dictionaries) "is an unordered set of name/value pairs". PHPUnit's JSON comparsion assertions (assertJsonStringEqualsJsonString and friends) appear to enforce an ordered set.
The internals suggest this is supposed to be handled already. I tried adding SORT_STRING as a flag to ksorthere and it seemed to fix things, but I hardly did exhaustive testing.
Somewhat related to #4584, but more in the sense that it's impossible to maintain a native PHP array that 1:1 matches certain JSON due to numeric key conversion. Getting that all correct is tragically difficult.
Summary
According to the JSON spec outlined at json.org, an object (dictionaries) "is an unordered set of name/value pairs". PHPUnit's JSON comparsion assertions (
assertJsonStringEqualsJsonString
and friends) appear to enforce an ordered set.The internals suggest this is supposed to be handled already. I tried adding
SORT_STRING
as a flag toksort
here and it seemed to fix things, but I hardly did exhaustive testing.Somewhat related to #4584, but more in the sense that it's impossible to maintain a native PHP array that 1:1 matches certain JSON due to numeric key conversion. Getting that all correct is tragically difficult.
Current behavior
How to reproduce
Expected behavior
Above test case passes.
The text was updated successfully, but these errors were encountered: