php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /proc/self/root/var/www/html/sub/images/Rm19_symconf/root/php-7.1.11/ext/dom/tests/ |
| files >> //proc/self/root/var/www/html/sub/images/Rm19_symconf/root/php-7.1.11/ext/dom/tests/bug32615.phpt |
--TEST--
Bug #32615 (Replacing and inserting Fragments)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new DomDocument;
$frag = $dom->createDocumentFragment();
$frag->appendChild(new DOMElement('root'));
$dom->appendChild($frag);
$root = $dom->documentElement;
$frag->appendChild(new DOMElement('first'));
$root->appendChild($frag);
$frag->appendChild(new DOMElement('second'));
$root->appendChild($frag);
$node = $dom->createElement('newfirst');
$frag->appendChild($node);
$root->replaceChild($frag, $root->firstChild);
unset($frag);
$frag = $dom->createDocumentFragment();
$frag->appendChild(new DOMElement('newsecond'));
$root->replaceChild($frag, $root->lastChild);
$node = $frag->appendChild(new DOMElement('fourth'));
$root->insertBefore($frag, NULL);
$frag->appendChild(new DOMElement('third'));
$node = $root->insertBefore($frag, $node);
$frag->appendChild(new DOMElement('start'));
$root->insertBefore($frag, $root->firstChild);
$frag->appendChild(new DOMElement('newthird'));
$root->replaceChild($frag, $node);
$frag->appendChild(new DOMElement('newfourth'));
$root->replaceChild($frag, $root->lastChild);
$frag->appendChild(new DOMElement('first'));
$root->replaceChild($frag, $root->firstChild->nextSibling);
$root->removeChild($root->firstChild);
echo $dom->saveXML()."\n";
while ($root->hasChildNodes()) {
$root->removeChild($root->firstChild);
}
$frag->appendChild(new DOMElement('first'));
$root->insertBefore($frag, $root->firstChild);
$node = $frag->appendChild(new DOMElement('fourth'));
$root->appendChild($frag);
$frag->appendChild(new DOMElement('second'));
$frag->appendChild(new DOMElement('third'));
$root->insertBefore($frag, $node);
echo $dom->saveXML()."\n";
$frag = $dom->createDocumentFragment();
$root = $dom->documentElement;
$root->replaceChild($frag, $root->firstChild);
echo $dom->saveXML();
?>
--EXPECT--
<?xml version="1.0"?>
<root><first/><newsecond/><newthird/><newfourth/></root>
<?xml version="1.0"?>
<root><first/><second/><third/><fourth/></root>
<?xml version="1.0"?>
<root><second/><third/><fourth/></root>
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`