http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88653
Revision: 88653
Author: ialex
Date: 2011-05-23 17:22:14 +0000 (Mon, 23 May 2011)
Log Message:
-----------
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()?
Modified Paths:
--------------
trunk/phase3/tests/parser/parserTest.inc
Modified: trunk/phase3/tests/parser/parserTest.inc
===================================================================
--- trunk/phase3/tests/parser/parserTest.inc 2011-05-23 17:07:59 UTC (rev
88652)
+++ trunk/phase3/tests/parser/parserTest.inc 2011-05-23 17:22:14 UTC (rev
88653)
@@ -166,8 +166,9 @@
// $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 @@
$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 @@
$wgHooks['ParserGetVariableValueTs'][] =
'ParserTest::getFakeTimestamp';
MagicWord::clearCache();
-
- global $wgUser;
- $wgUser = new User();
}
/**
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs