comparator icon indicating copy to clipboard operation
comparator copied to clipboard

Issue #77: Canonicalizing associative arrays is now done by using ksort instead of sort

Open alecsmrekar opened this issue 4 years ago • 0 comments

This covers issue #77 which is also the cause for PHPUnit Issues #4455.

The first change is in "src/ArrayComparator.php" where we first detect if the expected array has any non-integer keys. If that is the case, we treat both arrays as associative and sort them with ksort() instead of sort().

The second change is test coverage of the above logic in "tests/ArrayComparatorTest.php".

alecsmrekar avatar Apr 12 '21 17:04 alecsmrekar