php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt
2020-08-09 22:03:36 +02:00

25 lines
518 B
PHP

--TEST--
Testing DOMDocumentFragment::appendXML and DOMDocumentFragment::hasChildNodes
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
$fragment = $doc->createDocumentFragment();
if ($fragment->hasChildNodes()) {
echo "has child nodes\n";
} else {
echo "has no child nodes\n";
}
$fragment->appendXML('<foo>bar</foo>');
if ($fragment->hasChildNodes()) {
echo "has child nodes\n";
} else {
echo "has no child nodes\n";
}
?>
--EXPECT--
has no child nodes
has child nodes