Skip to content

Conversation

DBX12
Copy link

@DBX12 DBX12 commented Jul 31, 2024

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
Copy link
Member

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
Copy link
Author

DBX12 commented Aug 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants