phpstan-phpunit
phpstan-phpunit copied to clipboard
AssertEqualsIsDiscouraged
This rule is even more opinionated than the previous ones.
If you don't think it should be included in PHPStan, I can change it and keep only the first part (which suggests assertSame in for the same types)
I submitted a review 😊 Also please rebase your branch on master and fix PHP 7.1-related CS errors.
R4R @ondrejmirtes (I kept the fixes in the separate commits for easier review)
Any feedback on this one?
TBH I don't think this belongs here directly, it should be in phpstan-strict-rules (or i.e. phpstan-phpunit-strict-rules), or at least in separate ruleset (i.e. strict-rules.neon).
I just made a very similar rule to my package, check it out and feel free to comment.
It forbids assertEquals with any scalar type, no matter whether the two arguments are of the same type or not.
https://github.com/ikvasnica/phpstan-clean-test/pull/12