Page MenuHomePhabricator

Make EntityDataUriManagerTest a proper unit test
Open, Needs TriagePublic

Description

The WikibaseRepo.EntityDataUriManager service wiring currently uses the SpecialPage::getTitleFor() method. This means that the unit test for that service wiring actually can’t run without MediaWiki being set up, because SpecialPage::getTitleFor() uses the default MediaWiki service container. We can’t mock SpecialPage::getTitleFor() directly because it’s a static method, so we need some kind of replacement.

Since SpecialPage::getTitle(Value)For() is already implemented in terms of the SpecialPageFactory service, I think it would make sense to add a getTitle(Value)For() method to that interface as well. (I’m not sure which of getTitleFor() and/or getTitleValueFor() should be added; our service wiring could always convert between the two using the TitleFactory service.)