Rector: [Proposal][PHPUnit] AssertTrueFalseComparisonToSpecificMethodRector

Created on 23 Dec 2017  路  4Comments  路  Source: rectorphp/rector

There are a lot of comparisons that could be refactor to PHPUnit assertion method:

Current | Better
-- | -
assertTrue($foo === $bar) | assertSame($bar, $foo)
assertTrue($foo <> $bar) | assertNotEquals($bar, $foo)
assertTrue($foo >= $bar) | assertGreaterThanOrEqual($bar, $foo)

@TomasVotruba What do you think? Can I propose this Rector? :innocent:

Nikita's PHP-Parser does handle it :+1:

All 4 comments

Sure, that makes sense :mrs_claus:

Feel free to do these in PR from the start, no need to create issue for it.
Closing the question is answered, to keep only still relevent issues.

I'm just finishing to work on #217, I'll start this one!

Take your time. Better 1 finished PR than 5 opened issues :1st_place_medal:

Was this page helpful?
0 / 5 - 0 ratings