From 9d98f581bb2e3b1de549d2ce1becab9a1368253a Mon Sep 17 00:00:00 2001 From: Platonides Date: Sat, 27 Aug 2011 21:10:41 +0000 Subject: [PATCH] Manually set the title as not being a redirect. Otherwise, it needed a database from Parser::getFunctionLang() -> Title::getPageLanguage() -> Title::isRedirect() --- tests/phpunit/includes/parser/MagicVariableTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index f70c764a03..679a9c8633 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -38,8 +38,12 @@ class MagicVariableTest extends MediaWikiTestCase { # initialize parser output $this->testParser->clearState(); + # Needs a title to do magic word stuff - $this->testParser->setTitle( Title::newFromText( 'Tests' ) ); + $title = Title::newFromText( 'Tests' ); + $title->mRedirect = false; # Else it needs a db connection just to check if it's a redirect (when deciding the page language) + + $this->testParser->setTitle( $title ); } /** destroy parser (TODO: is it really neded?)*/ -- 2.20.1