X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FXmlTest.php;h=ab9abbb429be10cb059f10a0c1f63854afb89e04;hb=3b0effb20334f19f662aed6760ddfe7d4b43c6d6;hp=c5572b46c6c79a68fa255152bfc80d47ae39261f;hpb=232cb19c0a27ee306984bda5bcd5c6c1815734e2;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php
index c5572b46c6..ab9abbb429 100644
--- a/tests/phpunit/includes/XmlTest.php
+++ b/tests/phpunit/includes/XmlTest.php
@@ -34,6 +34,11 @@ class XmlTest extends MediaWikiTestCase {
] );
}
+ protected function tearDown() {
+ Language::factory( 'en' )->resetNamespaces();
+ parent::tearDown();
+ }
+
/**
* @covers Xml::expandAttributes
*/
@@ -50,7 +55,7 @@ class XmlTest extends MediaWikiTestCase {
* @covers Xml::expandAttributes
*/
public function testExpandAttributesException() {
- $this->setExpectedException( 'MWException' );
+ $this->setExpectedException( MWException::class );
Xml::expandAttributes( 'string' );
}
@@ -92,8 +97,8 @@ class XmlTest extends MediaWikiTestCase {
*/
public function testElementEscaping() {
$this->assertEquals(
- 'hello <there> you & you',
- Xml::element( 'element', null, 'hello you & you' ),
+ '"hello <there> your\'s & you"',
+ Xml::element( 'element', null, '"hello your\'s & you"' ),
'Element with no attributes and content that needs escaping'
);
}
@@ -136,6 +141,57 @@ class XmlTest extends MediaWikiTestCase {
$this->assertEquals( '', Xml::closeElement( 'element' ), 'closeElement() shortcut' );
}
+ public function provideMonthSelector() {
+ global $wgLang;
+
+ $header = '