Page MenuHomePhabricator
Paste P17803

(An Untitled Masterwork)
ActivePublic

Authored by Urbanecm_WMF on Tue, Nov 23, 10:29 PM.
urbanecm@notebook ~/unsynced/gerrit/mediawiki/extensions/GrowthExperiments
$ git diff
diff --git a/tests/phpunit/integration/NewcomerTasks/ImageRecommendationFilterTest.php b/tests/phpunit/integration/NewcomerTasks/ImageRecommendationFilterTest.php
index 6ed4458a..215f94cd 100644
--- a/tests/phpunit/integration/NewcomerTasks/ImageRecommendationFilterTest.php
+++ b/tests/phpunit/integration/NewcomerTasks/ImageRecommendationFilterTest.php
@@ -36,7 +36,19 @@ class ImageRecommendationFilterTest extends MediaWikiIntegrationTestCase {
public function testFilter() {
$taskSet = $this->getDefaultTaskSet();
- $wanObjectCache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ // We need a WAN cache for this.
+ global $wgWANObjectCaches;
+ $this->setMwGlobals( [
+ 'wgMainWANCache' => 'hash',
+ 'wgWANObjectCaches' => $wgWANObjectCaches + [
+ 'hash' => [
+ 'class' => WANObjectCache::class,
+ 'cacheId' => 'hash',
+ 'channels' => []
+ ]
+ ]
+ ] );
+ $wanObjectCache = $this->getServiceContainer()->getMainWANObjectCache();
$wanObjectCache->set(
ImageRecommendationFilter::makeKey( $wanObjectCache, 'image-recommendation', 'Task3' ),
true
urbanecm@notebook ~/unsynced/gerrit/mediawiki/extensions/GrowthExperiments
$