Move Test files under same folder structure where class is (/includes/)
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / XmlTypeCheckTest.php
1 <?php
2 /**
3 * PHPUnit tests for XMLTypeCheck.
4 * @author physikerwelt
5 * @group Xml
6 * @covers XMLTypeCheck
7 */
8 class XmlTypeCheckTest extends MediaWikiTestCase {
9 const WELL_FORMED_XML = "<root><child /></root>";
10 const MAL_FORMED_XML = "<root><child /></error>";
11
12 /**
13 * @covers XMLTypeCheck::newFromString
14 * @covers XMLTypeCheck::getRootElement
15 */
16 public function testWellFormedXML() {
17 $testXML = XmlTypeCheck::newFromString( self::WELL_FORMED_XML );
18 $this->assertTrue( $testXML->wellFormed );
19 $this->assertEquals( 'root', $testXML->getRootElement() );
20 }
21
22 /**
23 * @covers XMLTypeCheck::newFromString
24 */
25 public function testMalFormedXML() {
26 $testXML = XmlTypeCheck::newFromString( self::MAL_FORMED_XML );
27 $this->assertFalse( $testXML->wellFormed );
28 }
29
30 }