Page MenuHomePhabricator

Analzye if MediaWiki.PHPUni.tAssertionOrder could handle more complex cases
Open, Needs TriagePublic

Description

The sniff assumed the sequence of tokens

variable + [optional whitespace] + comma+ [optional whitespace] + fixed value + [optional whitespace] + comma or close parenthesis

but the first part after assertEquals or assertSame could be a bit more complex to swap the values.
Like function calls (chain of function calls) or array access or array definition

See the following patch sets for some cases to get autofixed (in my opinion):
*https://gerrit.wikimedia.org/r/c/mediawiki/core/+/668815
*https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageImages/+/684842

Event Timeline

We can use some of the logic in AssertCountSniff to skip past the first parameter - will try to work on this soon