http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94643

Revision: 94643
Author:   ialex
Date:     2011-08-16 15:17:35 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
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
    trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
    trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php
    trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php

Modified: trunk/phase3/tests/parser/parserTest.inc
===================================================================
--- trunk/phase3/tests/parser/parserTest.inc    2011-08-16 14:55:04 UTC (rev 
94642)
+++ trunk/phase3/tests/parser/parserTest.inc    2011-08-16 15:17:35 UTC (rev 
94643)
@@ -170,7 +170,7 @@
                $wgLang = $context->getLang();
                $wgOut = $context->getOutput();
                $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], 
array( $wgParserConf ) );
-               $wgRequest = new WebRequest;
+               $wgRequest = $context->getRequest();
 
                if ( $wgStyleDirectory === false ) {
                        $wgStyleDirectory   = "$IP/skins";

Modified: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/ExtraParserTest.php     2011-08-16 
14:55:04 UTC (rev 94642)
+++ trunk/phase3/tests/phpunit/includes/ExtraParserTest.php     2011-08-16 
15:17:35 UTC (rev 94643)
@@ -10,11 +10,13 @@
                global $wgContLang;
                global $wgShowDBErrorBacktrace;
                global $wgLanguageCode;
+               global $wgAlwaysUseTidy;
 
                $wgShowDBErrorBacktrace = true;
                $wgLanguageCode = 'en';
                $wgContLang = new Language( 'en' );
                $wgMemc = new EmptyBagOStuff;
+               $wgAlwaysUseTidy = false;
                
                $this->options = new ParserOptions;
                $this->options->setTemplateCallback( array( __CLASS__, 
'statelessFetchTemplate' ) );

Modified: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php        
2011-08-16 14:55:04 UTC (rev 94642)
+++ trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php        
2011-08-16 15:17:35 UTC (rev 94643)
@@ -82,7 +82,7 @@
                $tmpGlobals['wgLang'] = $context->getLang();
                $tmpGlobals['wgOut'] = $context->getOutput();
                $tmpGlobals['wgParser'] = new StubObject( 'wgParser', 
$GLOBALS['wgParserConf']['class'], array( $GLOBALS['wgParserConf'] ) );
-               $tmpGlobals['wgRequest'] = new WebRequest;
+               $tmpGlobals['wgRequest'] = $context->getRequest();
 
                if ( $GLOBALS['wgStyleDirectory'] === false ) {
                        $tmpGlobals['wgStyleDirectory'] = "$IP/skins";

Modified: trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php
===================================================================
--- trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php        
2011-08-16 14:55:04 UTC (rev 94642)
+++ trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php        
2011-08-16 15:17:35 UTC (rev 94643)
@@ -52,7 +52,7 @@
                $wgLang = $context->getLang();
                $wgOut = $context->getOutput();
                $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], 
array( $wgParserConf ) );
-               $wgRequest = new WebRequest;
+               $wgRequest = $context->getRequest();
 
                if ( $wgStyleDirectory === false ) {
                        $wgStyleDirectory   = "$IP/skins";


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to