-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
feature/assertionIssues related to assertions and expectationsIssues related to assertions and expectationstype/enhancementA new idea that should be implementedA new idea that should be implemented
Description
Key order when we're talking about associative arrays is quite often irrelevant, especially when checking stuff that will end up being json serialized where dictionaries do not guarantee the key order.
Right now I'm stuck between using assertEqualsCanonicalizing and risking datatype errors, e.g.:
$this->assertEqualsCanonicalizing(['foo' => 1], ['foo' => '1']); // true
Or use assertSame but then key order tends to make tests extra brittle. Having an option for assertSame or a new assertDictionarySame or something would be great.
darthf1, mvorisek and christeredvartsen
Metadata
Metadata
Assignees
Labels
feature/assertionIssues related to assertions and expectationsIssues related to assertions and expectationstype/enhancementA new idea that should be implementedA new idea that should be implemented