Use mergeMwGlobalArrayValue in LocalisationCacheTest
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 15 Oct 2014 15:39:27 +0000 (17:39 +0200)
committerAddshore <addshorewiki@gmail.com>
Thu, 23 Oct 2014 17:42:36 +0000 (17:42 +0000)
Change-Id: I8cfe494d159101306c699169dd224c3bea65c753

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' );