Page MenuHomePhabricator

Make PHPUnit dataProvider static in CampaignEvents tests
Open, Needs TriagePublic

Description

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

  • EventFactoryTest with provideEventData
  • ArticleViewHeaderHandlerTest with provideArticle
  • ListParticipantsHandlerTest with provideRunData and provideRunErrors
  • DeleteEventCommandTest with provideRegistrationAndStore
  • EditEventCommandTest with providePageWithRegistrationAlreadyEnabled, provideEditUnsafeErrors` and provideEventRegistrations
  • EventRegistrationTest with provideInvalidTimestampFormat, provideEventsForUTCConversion and provideAmbiguousLocalTimes
  • EventPageCacheUpdaterTest with provideRegistrations
  • PageMoveAndDeleteHandlerTest with providePageDelete
  • CampaignsPageFactoryTest with provideTitleStrings
  • MWPermissionsLookupTest with provideUserHasRight, provideUserIsSitewideBlocked and provideUserIsRegistered
  • PageURLResolverTest with providePageAndURL
  • RegisterParticipantCommandTest with provideInvalidRegistrationsAndErrors, provideStoreAndModified and provideRegisterUnsafeErrors
  • UnregisterParticipantCommandTest with provideStoreAndModified and provideUnregisterUnsafeErrors
  • PermissionCheckerTest with provideCanEnableRegistrations, provideCanOrganizeEvents, provideCanEnableRegistration, provideGenericEditPermissions, provideCanDeleteRegistration and provideCanRegisterForEvents
  • CancelEventRegistrationHandlerTest with provideRequestDataWithErrors and provideRequestDataSuccessful
  • DeleteEventRegistrationHandlerTest with provideErrorData
  • EnableEventRegistrationHandlerTest with provideExecuteDataForValidationTest
  • ListEventsByOrganizerHandlerTest with provideExecuteDataForEventListingTest
  • ListEventsByParticipantHandlerTest with provideExecuteDataForEventListingTest
  • ListOrganizersHandlerTest with provideRunData
  • Rest\RegisterForEventHandlerTest with provideRequestDataWithErrors and provideRequestDataSuccessful
  • RemoveParticipantsFromEventHandlerTest with provideRequestDataWithErrors and provideRequestDataSuccessful
  • Rest\SetOrganizersHandlerTest with provideCommandErrors
  • UpdateEventRegistrationHandlerTest with provideExecuteDataForValidationTest
  • EventTimeFormatterTest with provideDates and provideTimezones

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

Initial work was done in 4d745381debfe28cbea15e67be50534624e675be

Event Timeline

Change #1050067 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] tests: Make data providers static in PermissionCheckerTest, part 1

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

Change #1050073 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] tests: Make remaining data providers static in PermissionCheckerTest

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

Change #1050067 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] tests: Make data providers static in PermissionCheckerTest, part 1

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

Change #1050073 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] tests: Make remaining data providers static in PermissionCheckerTest

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

Anything left to do here?

Yeah, a lot unfortunately...