Codeception / Verify

BDD Assertions for PHPUnit and Codeception
MIT License
146 stars 25 forks source link

Extend docblock about same and equals regarding their type safety #60

Open DBX12 opened 3 months ago

DBX12 commented 3 months ago

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.

TavoNiievez commented 3 months ago

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.

DBX12 commented 3 months ago

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