Page MenuHomePhabricator

Make OtherProjectsSitesProviderTest a proper unit test
Closed, ResolvedPublic

Description

The WikibaseClient.OtherProjectsSitesProvider service wiring uses the ObjectCache::getLocalClusterInstance() function, which means that the unit test for that service wiring actually can’t run without MediaWiki being set up, because ObjectCache::getLocalClusterInstance() uses MediaWiki globals and the default service container.

A solution for this almost certainly requires T243233: MediaWiki should provide a LocalClusterObjectCache service.

See also: T281706, T281710.

To reproduce:

composer phpunit extensions/Wikibase/client/tests/phpunit/unit/includes/ServiceWiring/OtherProjectsSitesProviderTest.php

Event Timeline

Change #1036290 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Use ObjectCacheFactory in OtherProjectsSitesProvider service wiring

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

Change #1036290 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use ObjectCacheFactory in OtherProjectsSitesProvider service wiring

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