Php-cs-fixer: php_unit_strict rule should not convert assertEquals method to assertSame when delta param is filled

Created on 6 Apr 2018  Â·  5Comments  Â·  Source: FriendsOfPHP/PHP-CS-Fixer

The PHP version you are using ($ php -v):

=>PHP 7.1.12-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Dec 14 2017 15:37:13) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.12-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

PHP CS Fixer version you are using ($ php-cs-fixer -V):

=> PHP CS Fixer 2.11.1 Grey Devil by Fabien Potencier and Dariusz Ruminski

I'm having an issue with the php_unit_strict rule. Indeed when the delta parameter is filled in the assertEquals method, the rule converts the method into assertSame but both method signature don't match.
I think this rule should not touch asertEquals methods when delta is filled and should not raise an error.

What do you think?

kinbug

Most helpful comment

Of course no problem! I will not be available for the next days but I'll work on it after!

All 5 comments

indeed.
could you raise a fix PR please ?

Of course no problem! I will not be available for the next days but I'll work on it after!

note to self/whoever can work this:

  • using an instance of the ArgumentsAnalyzer PhpUnitStrictFixer::applyFix might be the best way to fix this

Ooops too slow to react... Sorry

no worries @tifabien :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amitbisht511 picture amitbisht511  Â·  3Comments

kcloze picture kcloze  Â·  3Comments

OskarStark picture OskarStark  Â·  3Comments

aidantwoods picture aidantwoods  Â·  3Comments

teohhanhui picture teohhanhui  Â·  3Comments