From: Platonides Date: Mon, 27 Dec 2010 16:51:59 +0000 (+0000) Subject: Replace __METHOD__ with __FUNCTION__ X-Git-Tag: 1.31.0-rc.0~33058 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=9af104c4d3cbcbb06899afbd8246eeda3e417330;p=lhc%2Fweb%2Fwiklou.git Replace __METHOD__ with __FUNCTION__ Using a title like testParse instead of ExtraParserTest::testParse (thus without colons), means that it doesn't need to be checked if it's an interwiki, and no interwiki db (either Cdb or normal db) is needed. So these tests can be run as Databaseless. --- diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php index 981bdfc1d0..130a1c4012 100644 --- a/tests/phpunit/includes/ExtraParserTest.php +++ b/tests/phpunit/includes/ExtraParserTest.php @@ -35,21 +35,21 @@ class ExtraParserTest extends PHPUnit_Framework_TestCase { /* Test the parser entry points */ function testParse() { - $title = Title::newFromText( __METHOD__ ); + $title = Title::newFromText( __FUNCTION__ ); $parserOutput = $this->parser->parse( "Test\n{{Foo}}\n{{Bar}}" , $title, $this->options ); $this->assertEquals( "

Test\nContent of Template:Foo\nContent of Template:Bar\n

", $parserOutput->getText() ); } function testPreSaveTransform() { global $wgUser; - $title = Title::newFromText( __METHOD__ ); + $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options ); $this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText ); } function testPreprocess() { - $title = Title::newFromText( __METHOD__ ); + $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->preprocess( "Test\n{{Foo}}\n{{Bar}}" , $title, $this->options ); $this->assertEquals( "Test\nContent of ''Template:Foo''\nContent of ''Template:Bar''", $outputText ); @@ -59,7 +59,7 @@ class ExtraParserTest extends PHPUnit_Framework_TestCase { * cleanSig() makes all templates substs and removes tildes */ function testCleanSig() { - $title = Title::newFromText( __METHOD__ ); + $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); $this->assertEquals( "{{SUBST:Foo}} ", $outputText ); @@ -69,7 +69,7 @@ class ExtraParserTest extends PHPUnit_Framework_TestCase { * cleanSigInSig() just removes tildes */ function testCleanSigInSig() { - $title = Title::newFromText( __METHOD__ ); + $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->cleanSigInSig( "{{Foo}} ~~~~" ); $this->assertEquals( "{{Foo}} ", $outputText ); @@ -93,7 +93,7 @@ class ExtraParserTest extends PHPUnit_Framework_TestCase { * Templates and comments are not affected, but noinclude/onlyinclude is. */ function testGetPreloadText() { - $title = Title::newFromText( __METHOD__ ); + $title = Title::newFromText( __FUNCTION__ ); $outputText = $this->parser->getPreloadText( "{{Foo}} censored information ", $title, $this->options ); $this->assertEquals( "{{Foo}} information ", $outputText );