r80827 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80826‎ | r80827 | r80828 >
Date:18:43, 23 January 2011
Author:platonides
Status:ok
Tags:
Comment:
preSaveTransform() needs $wgTitle.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/ExtraParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
@@ -41,11 +41,13 @@
4242 }
4343
4444 function testPreSaveTransform() {
45 - global $wgUser;
 45+ global $wgUser, $wgTitle;
4646 $title = Title::newFromText( __FUNCTION__ );
 47+ $oldTitle = $wgTitle; $wgTitle = $title; # Used by transformMsg()
4748 $outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options );
48 -
 49+
4950 $this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText );
 51+ $wgTitle = $oldTitle;
5052 }
5153
5254 function testPreprocess() {

Status & tagging log