r94643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94642‎ | r94643 | r94644 >
Date:15:17, 16 August 2011
Author:ialex
Status:ok
Tags:
Comment:
Some misc fixes to tests:
* Don't create a WebRequest instance to put in $wgRequest in test since it is meant for HTTP requests, not command line ones
* Force $wgAlwaysUseTidy to false in ExtraParserTest, having it to true breaks testBug8689() and testParse()
Modified paths:
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/ExtraParserTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
@@ -10,11 +10,13 @@
1111 global $wgContLang;
1212 global $wgShowDBErrorBacktrace;
1313 global $wgLanguageCode;
 14+ global $wgAlwaysUseTidy;
1415
1516 $wgShowDBErrorBacktrace = true;
1617 $wgLanguageCode = 'en';
1718 $wgContLang = new Language( 'en' );
1819 $wgMemc = new EmptyBagOStuff;
 20+ $wgAlwaysUseTidy = false;
1921
2022 $this->options = new ParserOptions;
2123 $this->options->setTemplateCallback( array( __CLASS__, 'statelessFetchTemplate' ) );
Index: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php
@@ -82,7 +82,7 @@
8383 $tmpGlobals['wgLang'] = $context->getLang();
8484 $tmpGlobals['wgOut'] = $context->getOutput();
8585 $tmpGlobals['wgParser'] = new StubObject( 'wgParser', $GLOBALS['wgParserConf']['class'], array( $GLOBALS['wgParserConf'] ) );
86 - $tmpGlobals['wgRequest'] = new WebRequest;
 86+ $tmpGlobals['wgRequest'] = $context->getRequest();
8787
8888 if ( $GLOBALS['wgStyleDirectory'] === false ) {
8989 $tmpGlobals['wgStyleDirectory'] = "$IP/skins";
Index: trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php
@@ -52,7 +52,7 @@
5353 $wgLang = $context->getLang();
5454 $wgOut = $context->getOutput();
5555 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
56 - $wgRequest = new WebRequest;
 56+ $wgRequest = $context->getRequest();
5757
5858 if ( $wgStyleDirectory === false ) {
5959 $wgStyleDirectory = "$IP/skins";
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -170,7 +170,7 @@
171171 $wgLang = $context->getLang();
172172 $wgOut = $context->getOutput();
173173 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
174 - $wgRequest = new WebRequest;
 174+ $wgRequest = $context->getRequest();
175175
176176 if ( $wgStyleDirectory === false ) {
177177 $wgStyleDirectory = "$IP/skins";

Status & tagging log