Manually set the title as not being a redirect. Otherwise,
authorPlatonides <platonides@users.mediawiki.org>
Sat, 27 Aug 2011 21:10:41 +0000 (21:10 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sat, 27 Aug 2011 21:10:41 +0000 (21:10 +0000)
it needed a database from Parser::getFunctionLang() ->
Title::getPageLanguage() -> Title::isRedirect()

tests/phpunit/includes/parser/MagicVariableTest.php

index f70c764..679a9c8 100644 (file)
@@ -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?)*/