From: Alexandre Emsenhuber Date: Mon, 23 May 2011 17:53:31 +0000 (+0000) Subject: Follow-up r88653: removed the remaining of OutputPage's stubbing X-Git-Tag: 1.31.0-rc.0~29991 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=236e3fd6c6580d87ecfbe57c742f308338632c0a;p=lhc%2Fweb%2Fwiklou.git Follow-up r88653: removed the remaining of OutputPage's stubbing --- diff --git a/tests/phpunit/includes/GlobalTest.php b/tests/phpunit/includes/GlobalTest.php index 31929d70db..fdcc82af56 100644 --- a/tests/phpunit/includes/GlobalTest.php +++ b/tests/phpunit/includes/GlobalTest.php @@ -523,8 +523,7 @@ class GlobalTest extends MediaWikiTestCase { $old_wgOut = $wgOut; $old_wgShowDebug = $wgShowDebug; - $wgOut = new StubObject( 'wgOut', 'MockOutputPage' ); - $wgOut->doNothing(); //just to unstub it + $wgOut = new MockOutputPage; $wgShowDebug = true; @@ -879,7 +878,5 @@ class MockOutputPage { function debug( $message ) { $this->message = "JAJA is a stupid error message. Anyway, here's your message: $message"; } - - function doNothing() {} } diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 8a2c7d1c17..b67909ec14 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -76,8 +76,9 @@ class NewParserTest extends MediaWikiTestCase { // $tmpGlobals['wgContLang'] = new StubContLang; $tmpGlobals['wgUser'] = new User; - $tmpGlobals['wgLang'] = new StubUserLang; - $tmpGlobals['wgOut'] = new StubObject( 'wgOut', 'OutputPage' ); + $context = new RequestContext(); + $tmpGlobals['wgLang'] = $context->lang; + $tmpGlobals['wgOut'] = $context->output; $tmpGlobals['wgParser'] = new StubObject( 'wgParser', $GLOBALS['wgParserConf']['class'], array( $GLOBALS['wgParserConf'] ) ); $tmpGlobals['wgRequest'] = new WebRequest; diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index db8efcef10..9e6bf7f221 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -48,8 +48,9 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { // $wgContLang = new StubContLang; $wgUser = new User; - $wgLang = new StubUserLang; - $wgOut = new StubObject( 'wgOut', 'OutputPage' ); + $context = new RequestContext; + $wgLang = $context->lang; + $wgOut = $context->output; $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); $wgRequest = new WebRequest;