From 181d5f6fd6773bd51bae15ac9b5f72a235139ac9 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 6 Nov 2014 21:03:21 +0100 Subject: [PATCH] Use mergeMwGlobalArrayValue in GenderCacheTest Also move the global setting to addDBData to let the test work correctly, because the global is used indirectly in User::saveSettings. Change-Id: I986d3a28e4fcc82ed84886c2970571e9fa6128be --- tests/phpunit/includes/cache/GenderCacheTest.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/includes/cache/GenderCacheTest.php b/tests/phpunit/includes/cache/GenderCacheTest.php index ce2db5d77a..04fb00d98a 100644 --- a/tests/phpunit/includes/cache/GenderCacheTest.php +++ b/tests/phpunit/includes/cache/GenderCacheTest.php @@ -6,14 +6,10 @@ */ class GenderCacheTest extends MediaWikiLangTestCase { - protected function setUp() { - global $wgDefaultUserOptions; - parent::setUp(); + function addDBData() { //ensure the correct default gender - $wgDefaultUserOptions['gender'] = 'unknown'; - } + $this->mergeMwGlobalArrayValue( 'wgDefaultUserOptions', array( 'gender' => 'unknown' ) ); - function addDBData() { $user = User::newFromName( 'UTMale' ); if ( $user->getID() == 0 ) { $user->addToDatabase(); -- 2.20.1