From 9af104c4d3cbcbb06899afbd8246eeda3e417330 Mon Sep 17 00:00:00 2001 From: Platonides Date: Mon, 27 Dec 2010 16:51:59 +0000 Subject: [PATCH] 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. --- tests/phpunit/includes/ExtraParserTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 ); -- 2.20.1