From 4eb980fe0ac027c72de41fa7e076e8feb806d613 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 18 Feb 2013 18:58:35 +0100 Subject: [PATCH] set wgLanguageCode in NewParserTests for all tests Change one method default and use a constant Change-Id: Id8d6817c616c289834c6af9ecbc183dbc76fbded --- tests/phpunit/includes/parser/NewParserTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 5c7597eabd..ec9ee1ab31 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -32,15 +32,11 @@ class NewParserTest extends MediaWikiTestCase { protected $file = false; protected function setUp() { - global $wgContLang, $wgLanguageCode; global $wgNamespaceProtection, $wgNamespaceAliases; global $wgHooks, $IP; parent::setUp(); - $wgLanguageCode = 'en'; - $wgContLang = Language::factory( 'en' ); - //Setup CLI arguments if ( $this->getCliArg( 'regex=' ) ) { $this->regex = $this->getCliArg( 'regex=' ); @@ -53,6 +49,8 @@ class NewParserTest extends MediaWikiTestCase { $tmpGlobals = array(); + $tmpGlobals['wgLanguageCode'] = 'en'; + $tmpGlobals['wgContLang'] = Language::factory( 'en' ); $tmpGlobals['wgScript'] = '/index.php'; $tmpGlobals['wgScriptPath'] = '/'; $tmpGlobals['wgArticlePath'] = '/wiki/$1'; @@ -236,7 +234,7 @@ class NewParserTest extends MediaWikiTestCase { * Set up the global variables for a consistent environment for each test. * Ideally this should replace the global configuration entirely. */ - protected function setupGlobals( $opts = '', $config = '' ) { + protected function setupGlobals( $opts = array(), $config = '' ) { global $wgFileBackends; # Find out values for some special options. $lang = @@ -300,7 +298,7 @@ class NewParserTest extends MediaWikiTestCase { 'wgRawHtml' => isset( $opts['rawhtml'] ), 'wgLang' => null, 'wgContLang' => null, - 'wgNamespacesWithSubpages' => array( 0 => isset( $opts['subpage'] ) ), + 'wgNamespacesWithSubpages' => array( NS_MAIN => isset( $opts['subpage'] ) ), 'wgMaxTocLevel' => $maxtoclevel, 'wgCapitalLinks' => true, 'wgNoFollowLinks' => true, -- 2.20.1