From cdd8c741d6d1d5c3d0a01cf141bfaa1c47351df8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 23 May 2011 17:22:14 +0000 Subject: [PATCH] Per comment on r87680: make parser tests work again. Can somebody explain me why on earth do we need ParserTest::setUp() since all of this is done before each test in ParserTest::setupGlobals()? --- tests/parser/parserTest.inc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index b1a4e224e1..55092cde73 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -166,8 +166,9 @@ class ParserTest { // $wgContLang = new StubContLang; $wgUser = new User; - $wgLang = new StubUserLang; - $wgOut = new StubObject( 'wgOut', 'OutputPage' ); + $context = new RequestContext; + $wgLang = $context->getLang(); + $wgOut = $context->getOutput(); $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); $wgRequest = new WebRequest; @@ -678,13 +679,14 @@ class ParserTest { $GLOBALS[$var] = $val; } - $langObj = Language::factory( $lang ); - $GLOBALS['wgContLang'] = $langObj; + $GLOBALS['wgContLang'] = Language::factory( $lang ); + $GLOBALS['wgMemc'] = new EmptyBagOStuff; + $context = new RequestContext(); $GLOBALS['wgLang'] = $context->getLang(); + $GLOBALS['wgOut'] = $context->getOutput(); - $GLOBALS['wgMemc'] = new EmptyBagOStuff; - $GLOBALS['wgOut'] = new $context->output; + $GLOBALS['wgUser'] = new User(); global $wgHooks; @@ -693,9 +695,6 @@ class ParserTest { $wgHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp'; MagicWord::clearCache(); - - global $wgUser; - $wgUser = new User(); } /** -- 2.20.1