Fix ArticleTablesTest after r81528. It needs to set both $wgLanguageCode and $wgContLang.
authorPlatonides <platonides@users.mediawiki.org>
Sun, 20 Feb 2011 00:44:33 +0000 (00:44 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sun, 20 Feb 2011 00:44:33 +0000 (00:44 +0000)
Added setUp() and teardown()

tests/phpunit/includes/ArticleTablesTest.php

index 96b4ea9..3db0b55 100644 (file)
@@ -6,13 +6,27 @@
  */
 class ArticleTablesTest extends MediaWikiTestCase {
        
+       function setUp() {
+               global $wgLanguageCode;
+               
+               $this->languageCode = $wgLanguageCode;
+       }
+       
+       function tearDown() {
+               global $wgLanguageCode, $wgContLang, $wgLang;
+               $wgLanguageCode = $this->languageCode;
+               $wgContLang = new StubContLang;
+               $wgLang = new StubUserLang;
+       }
+       
        function testbug14404() {
-               global $wgUser, $wgContLang, $wgLang;
+               global $wgUser, $wgContLang, $wgLanguageCode, $wgLang;
                
                $title = Title::newFromText("Bug 14404");
                $article = new Article( $title );
                $wgUser = new User();
                $wgUser->mRights = array( 'createpage', 'edit', 'purge' );
+               $wgLanguageCode = 'es';
                $wgContLang = Language::factory( 'es' );
                
                $wgLang = Language::factory( 'fr' );