Replace __METHOD__ with __FUNCTION__
authorPlatonides <platonides@users.mediawiki.org>
Mon, 27 Dec 2010 16:51:59 +0000 (16:51 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Mon, 27 Dec 2010 16:51:59 +0000 (16:51 +0000)
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

index 981bdfc..130a1c4 100644 (file)
@@ -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( "<p>Test\nContent of <i>Template:Foo</i>\nContent of <i>Template:Bar</i>\n</p>", $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}}<noinclude> censored</noinclude> information <!-- is very secret -->", $title, $this->options );
                
                $this->assertEquals( "{{Foo}} information <!-- is very secret -->", $outputText );