From a51674e204025ef3388ccfb1ea4803c0aa1c59b5 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 15 Oct 2014 17:39:27 +0200 Subject: [PATCH] Use mergeMwGlobalArrayValue in LocalisationCacheTest Change-Id: I8cfe494d159101306c699169dd224c3bea65c753 --- .../includes/cache/LocalisationCacheTest.php | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/includes/cache/LocalisationCacheTest.php b/tests/phpunit/includes/cache/LocalisationCacheTest.php index fc06a50126..35ff919924 100644 --- a/tests/phpunit/includes/cache/LocalisationCacheTest.php +++ b/tests/phpunit/includes/cache/LocalisationCacheTest.php @@ -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' ); -- 2.20.1