From fb5cebcc6de4e72f9266c325ea837517d03eaca3 Mon Sep 17 00:00:00 2001 From: Platonides Date: Sun, 23 Jan 2011 18:43:08 +0000 Subject: [PATCH] preSaveTransform() needs $wgTitle. --- tests/phpunit/includes/ExtraParserTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() { -- 2.20.1