Page MenuHomePhabricator

PHPCS should send a warning when tests don't call parent::setUp(), parent::tearDown(), etc.
Open, Needs TriagePublic

Description

Specifically, if a test overrides setUpBeforeClass, setUp, tearDown, or tearDownAfterClass the override should call the original parent method (for setup, the call normally goes at the start, and for tear down, it normally goes at the end, but having it anywhere is better than not having at all)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 682164 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Add new sniff MediaWiki.PHPUnit.ParentCall

https://gerrit.wikimedia.org/r/682164

Change 682164 abandoned by DannyS712:

[mediawiki/core@master] Add new sniff MediaWiki.PHPUnit.ParentCall

Reason:

oops, wrong repo

https://gerrit.wikimedia.org/r/682164

Change 682165 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/tools/codesniffer@master] Add new sniff MediaWiki.PHPUnit.ParentCall

https://gerrit.wikimedia.org/r/682165

I'm sorry that I haven't handled this task. I recently returned from a long bout of unexpected inactivity, and while I plan to resume my contributions here on Phabricator its unfair to claim tasks that I might not work on when others may be interested in handling them. I'm removing myself as the assignee in a batch-action, but if someone feels that I really should be the one to handle this task feel free to re-assign me and I'll take a look.