Merge "Avoid usage of deprecated wfGetMainCache() function"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 29 Apr 2019 02:29:28 +0000 (02:29 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 29 Apr 2019 02:29:28 +0000 (02:29 +0000)
tests/phpunit/includes/site/CachingSiteStoreTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php

index 0fdcf6d..f04d35c 100644 (file)
@@ -37,7 +37,7 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
 
                $store = new CachingSiteStore(
                        $this->getHashSiteStore( $testSites ),
-                       wfGetMainCache()
+                       ObjectCache::getLocalClusterInstance()
                );
 
                $sites = $store->getSites();
@@ -62,7 +62,9 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
         * @covers CachingSiteStore::saveSites
         */
        public function testSaveSites() {
-               $store = new CachingSiteStore( new HashSiteStore(), wfGetMainCache() );
+               $store = new CachingSiteStore(
+                       new HashSiteStore(), ObjectCache::getLocalClusterInstance()
+               );
 
                $sites = [];
 
@@ -108,7 +110,7 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
                                return $siteList;
                        } ) );
 
-               $store = new CachingSiteStore( $dbSiteStore, wfGetMainCache() );
+               $store = new CachingSiteStore( $dbSiteStore, ObjectCache::getLocalClusterInstance() );
 
                // initialize internal cache
                $this->assertGreaterThan( 0, $store->getSites()->count(), 'count sites' );
@@ -138,7 +140,9 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
         * @covers CachingSiteStore::clear
         */
        public function testClear() {
-               $store = new CachingSiteStore( new HashSiteStore(), wfGetMainCache() );
+               $store = new CachingSiteStore(
+                       new HashSiteStore(), ObjectCache::getLocalClusterInstance()
+               );
                $this->assertTrue( $store->clear() );
 
                $site = $store->getSite( 'enwiki' );
index 00d607f..3b6d6f2 100644 (file)
@@ -57,7 +57,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
 
                $wgParserCacheType = CACHE_NONE;
                DeferredUpdates::clearPendingUpdates();
-               $wgMemc = wfGetMainCache();
+               $wgMemc = ObjectCache::getLocalClusterInstance();
                $messageMemc = wfGetMessageCacheStorage();
 
                RequestContext::resetMain();