private static $oldLang;
private static $oldNamespaces;
- public function setUp() {
- global $wgLang, $wgContLang;
+ protected function setUp() {
+ parent::setUp();
- self::$oldLang = $wgLang;
- $wgLang = Language::factory( 'en' );
-
- // Hardcode namespaces during test runs,
- // so that html output based on existing namespaces
- // can be properly evaluated.
- self::$oldNamespaces = $wgContLang->getNamespaces();
- $wgContLang->setNamespaces( array(
+ $langObj = Language::factory( 'en' );
+ $langObj->setNamespaces( array(
-2 => 'Media',
-1 => 'Special',
0 => '',
100 => 'Custom',
101 => 'Custom_talk',
) );
- }
- public function tearDown() {
- global $wgLang, $wgContLang;
- $wgLang = self::$oldLang;
-
- $wgContLang->setNamespaces( self::$oldNamespaces );
+ $this->setMwGlobals( array(
+ 'wgLang' => $langObj,
+ 'wgHtml5' => true,
+ 'wgWellFormedXml' => true,
+ ) );
}
public function testExpandAttributes() {
"Date menu year is the current one when not specified"
);
- // @todo FIXME: next month can be in the next year
- // test failing because it is now december
+ $wantedYear = $nextMonth == 1 ? $curYear : $prevYear;
$this->assertEquals(
- Xml::dateMenu( $prevYear, $nextMonth ),
+ Xml::dateMenu( $wantedYear, $nextMonth ),
Xml::dateMenu( '', $nextMonth ),
"Date menu next month is 11 months ago"
);