preSaveTransform() needs $wgTitle.
This commit is contained in:
parent
a39b8f1311
commit
fb5cebcc6d
1 changed files with 4 additions and 2 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue