Verify icon indicating copy to clipboard operation
Verify copied to clipboard

Extend docblock about same and equals regarding their type safety

Open DBX12 opened this issue 1 year ago • 2 comments

I've stumbled into a mean error in my tests by using verify()->equals() all the time assuming it would perform a type safe comparison. At a certain point, I found out that I must use verify()->same() for a type safe comparison. Since I wasn't aware of equals being type-unsafe and same existing, I've added a bit about them to their respective documentation blocks in the hope it will help others as well.

DBX12 avatar Jul 31 '24 15:07 DBX12

Hi @DBX12 ,

These descriptions are based on PHPUnit: See https://github.com/sebastianbergmann/phpunit/blob/998130eb044284d0e727ca597588e24914e9bc65/src/Framework/Assert.php#L383

Since Codeception/Verify is just syntax sugar, this clarification should be made there first.

TavoNiievez avatar Jul 31 '24 22:07 TavoNiievez

Hey @TavoNiievez I've created an issue in phpunit proposing to add the documentation there as well.

DBX12 avatar Aug 02 '24 10:08 DBX12