phpunit
phpunit copied to clipboard
New assetion `assertSameObjects()` to compare objects
Assertion to compare objects of diff classes.
Syntax: function assertSameObjects(object $expected, object $actual, [bool $strict = false, string $message = ''])
Behavior:
- Converts given objects to arrays of public property values
- Sort array by properties/keys
- Comparing property values:
3.1. float values compares same as
assertEqualsWithDelta()3.2. if$strictis true, then compare values strictly(i.e. use===), else, recursive converts&sorts object values same as1.and2.and compare they using==