--TEST--
Test reading Element::${inner,outer}HTML on XML documents
--EXTENSIONS--
dom
--FILE--
createElement("container");
return $element;
}
$container = createContainer();
$container->append("Hello, world!");
var_dump($container->innerHTML);
var_dump($container->outerHTML);
$container = createContainer();
$container->append($dom->createComment("This is -a- comment"));
var_dump($container->innerHTML);
var_dump($container->outerHTML);
$container = createContainer();
// Note: intentionally typo'd to check whether the string matching against "xml" happens correctly
// i.e. no bugs with prefix-matching only.
$container->append($dom->createProcessingInstruction("xmll", ""));
var_dump($container->innerHTML);
var_dump($container->outerHTML);
$container = createContainer();
$container->append($dom->createProcessingInstruction("almostmalformed", ">?"));
var_dump($container->innerHTML);
var_dump($container->outerHTML);
$container = createContainer();
$element = $container->appendChild(createContainer());
$element->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'http://example.com/');
var_dump($container->innerHTML);
var_dump($container->outerHTML);
$container = createContainer();
$element = $container->appendChild(createContainer());
$element->setAttributeNS('urn:a', 'name', '');
$element->setAttributeNS('urn:b', 'name', '');
var_dump($container->innerHTML);
var_dump($container->outerHTML);
$dom = DOM\XMLDocument::createFromFile(__DIR__ . '/../../book.xml');
var_dump($dom->documentElement->innerHTML);
var_dump($dom->documentElement->outerHTML);
?>
--EXPECT--
string(13) "Hello, world!"
string(36) "Hello, world!"
string(26) ""
string(49) ""
string(9) ""
string(32) ""
string(22) "??>"
string(45) "??>"
string(12) ""
string(35) ""
string(72) ""
string(95) ""
string(167) "
The Grapes of Wrath
John Steinbeck
The Pearl
John Steinbeck
"
string(182) "
The Grapes of Wrath
John Steinbeck
The Pearl
John Steinbeck
"