Fix TimestampTest broken by 7e3386d4
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 23 Apr 2013 13:27:41 +0000 (15:27 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 23 Apr 2013 13:27:41 +0000 (15:27 +0200)
- Call RequestContext::getMain()->setLanguage() since
  MWTimestamp::getHumanTimestamp() will call getLanguage() to get the
  Language object (and it not always English depending on the order the
  tests are called)
- While I'm at it, use MediaWikiLangTestCase to avoid duplicating things

Change-Id: I910287ccf093ef5681cd09445501dccc8d3f4d14

tests/phpunit/includes/TimestampTest.php

index 2d550bc..e1e196a 100644 (file)
@@ -3,16 +3,12 @@
 /**
  * Tests timestamp parsing and output.
  */
-class TimestampTest extends MediaWikiTestCase {
+class TimestampTest extends MediaWikiLangTestCase {
 
        protected function setUp() {
                parent::setUp();
 
-               $this->setMwGlobals( array(
-                       'wgLanguageCode' => 'en',
-                       'wgContLang' => Language::factory( 'en' ),
-                       'wgLang' => Language::factory( 'en' ),
-               ) );
+               RequestContext::getMain()->setLanguage( Language::factory( 'en' ) );
        }
 
        /**