Merge "Use mergeMwGlobalArrayValue in LocalisationCacheTest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 23 Oct 2014 17:55:59 +0000 (17:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 23 Oct 2014 17:55:59 +0000 (17:55 +0000)
tests/phpunit/includes/cache/LocalisationCacheTest.php

index fc06a50..35ff919 100644 (file)
@@ -60,21 +60,23 @@ class LocalisationCacheTest extends MediaWikiTestCase {
        }
 
        public function testRecacheFallbacksWithHooks() {
-               global $wgHooks;
-
                // Use hook to provide updates for messages. This is what the
                // LocalisationUpdate extension does. See bug 68781.
-               $wgHooks['LocalisationCacheRecacheFallback'][] = function (
-                       LocalisationCache $lc,
-                       $code,
-                       array &$cache
-               ) {
-                       if ( $code === 'ru' ) {
-                               $cache['messages']['present-uk'] = 'ru-override';
-                               $cache['messages']['present-ru'] = 'ru-override';
-                               $cache['messages']['present-en'] = 'ru-override';
-                       }
-               };
+               $this->mergeMwGlobalArrayValue( 'wgHooks', array(
+                       'LocalisationCacheRecacheFallback' => array(
+                               function (
+                                       LocalisationCache $lc,
+                                       $code,
+                                       array &$cache
+                               ) {
+                                       if ( $code === 'ru' ) {
+                                               $cache['messages']['present-uk'] = 'ru-override';
+                                               $cache['messages']['present-ru'] = 'ru-override';
+                                               $cache['messages']['present-en'] = 'ru-override';
+                                       }
+                               }
+                       )
+               ) );
 
                $lc = new LocalisationCache( array( 'store' => 'detect' ) );
                $lc->recache( 'uk' );