preSaveTransform() needs $wgTitle.

This commit is contained in:
Platonides 2011-01-23 18:43:08 +00:00
parent a39b8f1311
commit fb5cebcc6d

View file

@ -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() {