Page MenuHomePhabricator

Make PHPUnit dataProvider static in AbuseFilter tests
Open, Needs TriagePublic

Description

The @dataProvider annotation should be a static function, check and make data provider in the extension, at least:

  • SchemaChangesHandlerTest with provideAbuseFilterUser
  • AbuseFilterPermissionManagerTest with provideCanEdit, provideCanEditFilter
  • BlockAutopromoteStoreTest with provideBlockAutopromote, provideUnblockAutopromote
  • BlockTest with provideRevert
  • ThrottleTest with provideThrottle, provideThrottleDataForIdentifiers
  • WarnTest with provideWarnsAndSuccess
  • FilterValidatorTest with provideSyntax, provideRestrictedActions, provideCheckAll
  • ParserStatusTest with provideIsValid
  • ParserTest with provideDeprecatedVars
  • VariableGeneratorTest with provideTitleVarsNotLazy
  • LazyVariableComputerTest with provideUserRelatedVars, provideTitleRelatedVars
  • VariablesManagerTest with provideDumpAllVars, provideGetVar

static and adjust the usages (More infos at T332865).

Initial work was done in faaa5126eb8ae878220c78adbeb69cc66e3137f2

Event Timeline

Change 930638 had a related patch set uploaded (by Matěj Suchánek; author: Matěj Suchánek):

[mediawiki/extensions/AbuseFilter@master] Make some non-static providers static

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

Change 930638 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Make some non-static providers static

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