3 * PHPUnit tests for XMLTypeCheck.
8 class XmlTypeCheckTest
extends MediaWikiTestCase
{
9 const WELL_FORMED_XML
= "<root><child /></root>";
10 const MAL_FORMED_XML
= "<root><child /></error>";
13 * @covers XMLTypeCheck::newFromString
14 * @covers XMLTypeCheck::getRootElement
16 public function testWellFormedXML() {
17 $testXML = XmlTypeCheck
::newFromString( self
::WELL_FORMED_XML
);
18 $this->assertTrue( $testXML->wellFormed
);
19 $this->assertEquals( 'root', $testXML->getRootElement() );
23 * @covers XMLTypeCheck::newFromString
25 public function testMalFormedXML() {
26 $testXML = XmlTypeCheck
::newFromString( self
::MAL_FORMED_XML
);
27 $this->assertFalse( $testXML->wellFormed
);