X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FXmlTest.php;h=3cc542214a1da7eea399421ab359dbaa45f97758;hb=2bc2e0b254be92b9161dc18733408e99608cd1d3;hp=93ed3dc710ce6092934dc94e7a4fd0847fea2a4c;hpb=125d6d5feceba4d3d740efb5be0be83058546a20;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php index 93ed3dc710..3cc542214a 100644 --- a/tests/phpunit/includes/XmlTest.php +++ b/tests/phpunit/includes/XmlTest.php @@ -4,17 +4,11 @@ class XmlTest extends MediaWikiTestCase { 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 => '', @@ -32,13 +26,10 @@ class XmlTest extends MediaWikiTestCase { 100 => 'Custom', 101 => 'Custom_talk', ) ); - } - public function tearDown() { - global $wgLang, $wgContLang; - $wgLang = self::$oldLang; - - $wgContLang->setNamespaces( self::$oldNamespaces ); + $this->setMwGlobals( array( + 'wgLang' => $langObj, + ) ); } public function testExpandAttributes() { @@ -112,9 +103,6 @@ class XmlTest extends MediaWikiTestCase { $this->assertEquals( '', Xml::closeElement( 'element' ), 'closeElement() shortcut' ); } - /** - * @group Broken - */ public function testDateMenu( ) { $curYear = intval(gmdate('Y')); $prevYear = $curYear - 1; @@ -126,7 +114,7 @@ class XmlTest extends MediaWikiTestCase { if( $nextMonth == 13 ) { $nextMonth = 1; } $this->assertEquals( - '