Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P17803
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Urbanecm_WMF
on Nov 23 2021, 10:29 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F34764112: raw-paste-data.txt
Nov 23 2021, 10:29 PM
2021-11-23 22:29:25 (UTC+0)
Subscribers
None
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
$
Event Timeline
Urbanecm_WMF
created this paste.
Nov 23 2021, 10:29 PM
2021-11-23 22:29:25 (UTC+0)
Log In to Comment