From: umherirrender Date: Mon, 18 Feb 2013 17:58:35 +0000 (+0100) Subject: set wgLanguageCode in NewParserTests for all tests X-Git-Tag: 1.31.0-rc.0~20646 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=4eb980fe0ac027c72de41fa7e076e8feb806d613;p=lhc%2Fweb%2Fwiklou.git set wgLanguageCode in NewParserTests for all tests Change one method default and use a constant Change-Id: Id8d6817c616c289834c6af9ecbc183dbc76fbded --- 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,