r88653 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88652‎ | r88653 | r88654 >
Date:17:22, 23 May 2011
Author:ialex
Status:ok
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/parserTest.inc
@@ -166,8 +166,9 @@
167167
168168 // $wgContLang = new StubContLang;
169169 $wgUser = new User;
170 - $wgLang = new StubUserLang;
171 - $wgOut = new StubObject( 'wgOut', 'OutputPage' );
 170+ $context = new RequestContext;
 171+ $wgLang = $context->getLang();
 172+ $wgOut = $context->getOutput();
172173 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
173174 $wgRequest = new WebRequest;
174175
@@ -678,13 +679,14 @@
679680 $GLOBALS[$var] = $val;
680681 }
681682
682 - $langObj = Language::factory( $lang );
683 - $GLOBALS['wgContLang'] = $langObj;
 683+ $GLOBALS['wgContLang'] = Language::factory( $lang );
 684+ $GLOBALS['wgMemc'] = new EmptyBagOStuff;
 685+
684686 $context = new RequestContext();
685687 $GLOBALS['wgLang'] = $context->getLang();
 688+ $GLOBALS['wgOut'] = $context->getOutput();
686689
687 - $GLOBALS['wgMemc'] = new EmptyBagOStuff;
688 - $GLOBALS['wgOut'] = new $context->output;
 690+ $GLOBALS['wgUser'] = new User();
689691
690692 global $wgHooks;
691693
@@ -693,9 +695,6 @@
694696 $wgHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp';
695697
696698 MagicWord::clearCache();
697 -
698 - global $wgUser;
699 - $wgUser = new User();
700699 }
701700
702701 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r88659Follow-up r88653: removed the remaining of OutputPage's stubbingialex17:53, 23 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87680$wgOut can no longer be a stub since r85278, so there's no need to check this...ialex08:50, 8 May 2011

Status & tagging log