forked from sebastianbergmann/phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(): bug fix
Follow up on 5716. Sorry, I screwed up. While the fix in 5716 correctly fixes the handling of array keys to be in line with PHP itself, it broke the differentiation between `isEqual` and `isIdentical` as the arrays were now being recreated in the order of the keys passed to the `$keysToBeConsidered` parameter. This is not problematic for the `assertArrayIsEqualToArrayOnlyConsideringListOfKeys()` assertion as the array order is not relevant there. However, it is problematic for the `assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()` assertion, where the array order is relevant. This commit fixes it. Includes unit test safeguarding the fix. And while the `assertArrayIs*ToArrayIgnoringListOfKeys()` assertions are not affected, I've also included a unit test for the issue for those assertions, just to be on the safe side.
- Loading branch information
Showing
2 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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