10 use MediaWikiCoversValidator;
15 const XML_WITH_PIH =
'<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/w/index.php"?><svg><child /></svg>';
23 $this->assertTrue( $testXML->wellFormed );
24 $this->assertEquals(
'root', $testXML->getRootElement() );
32 $this->assertFalse( $testXML->wellFormed );
42<?xml
version=
"1.0" encoding=
"utf-8"?>
44 <!ENTITY test
"&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;">
45 <!ENTITY a
"&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
46 <!ENTITY b
"&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
47 <!ENTITY
c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
48 <!ENTITY d
"&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
49 <!ENTITY
e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
50 <!ENTITY f
"&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
51 <!ENTITY g
"-00000000000000000000000000000000000000000000000000000000000000000000000-">
58 $this->assertFalse( $check->wellFormed );
71 'processing_instruction_handler' =>
function () use ( &$called ) {
76 $this->assertTrue( $called );
type show c for details The hypothetical commands show w and show c should show the appropriate parts of the General Public License Of the commands you use may be called something other than show w and show c
PHPUnit tests for XMLTypeCheck.
testRecursiveEntity()
Verify we check for recursive entity DOS.
testProcessingInstructionHandler()
XMLTypeCheck::processingInstructionHandler.
testMalFormedXML()
XMLTypeCheck::newFromString.
testWellFormedXML()
XMLTypeCheck::newFromString XMLTypeCheck::getRootElement.
static newFromString( $string, $filterCallback=null)
Alternative constructor: from string.
in this case you re responsible for computing and outputting the entire conflict i e