Page MenuHomePhabricator

Update CampaignEvents PHPUnit test so they don't assume that the Event: namespace can be used for event registration
Closed, ResolvedPublic

Description

CampaignEvents tests are currently assuming that event registration can be enabled in the Event: namespace. This assumption won't necessarily remain true once T387966 is implemented. Tests should be updated to explicitly set the configuration they are expecting. Additionally, some of our PHPUnit unit tests are actually integration tests because they need the NS_EVENT constant, which cannot be accessed in unit tests due to T310375. These tests could now use a core namespace (by changing the config as needed), and therefore become real unit tests.

Note that ideally, we would also do this for the selenium and api-testing suites. However, it is not possible for extensions to make arbitrary changes to the wiki configuration for those test types, and so those will need to keep assuming that the Event namespace is valid.

Event Timeline

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

[mediawiki/extensions/CampaignEvents@master] Clean up namespace usage in tests

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

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

[mediawiki/extensions/CampaignEvents@master] Add test for EventPageDecorator

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

Change #1132638 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Clean up namespace usage in tests

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

Change #1132655 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Add test for EventPageDecorator

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

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

[mediawiki/extensions/CampaignEvents@master] Make PageMoveAndDeleteHandlerTest a real unit test

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

Change #1133206 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Make PageMoveAndDeleteHandlerTest a real unit test

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