From: Platonides Date: Sun, 23 Jan 2011 18:43:08 +0000 (+0000) Subject: preSaveTransform() needs $wgTitle. X-Git-Tag: 1.31.0-rc.0~32403 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=fb5cebcc6de4e72f9266c325ea837517d03eaca3;p=lhc%2Fweb%2Fwiklou.git preSaveTransform() needs $wgTitle. --- diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php index 949262a519..94087fa423 100644 --- a/tests/phpunit/includes/ExtraParserTest.php +++ b/tests/phpunit/includes/ExtraParserTest.php @@ -41,11 +41,13 @@ class ExtraParserTest extends MediaWikiTestCase { } function testPreSaveTransform() { - global $wgUser; + global $wgUser, $wgTitle; $title = Title::newFromText( __FUNCTION__ ); + $oldTitle = $wgTitle; $wgTitle = $title; # Used by transformMsg() $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 ); + $wgTitle = $oldTitle; } function testPreprocess() {