php-src/ext/dom/tests/DOMNode_replaceChild_error2.phpt
Ilija Tovilo f39b5c4c25
Close PHP tags in tests
Closes GH-12422
2023-10-18 17:34:10 +02:00

20 lines
450 B
PHP

--TEST--
replaceChild() where the new node is a grandparent of the old node
--EXTENSIONS--
dom
--FILE--
<?php
$document = new DOMDocument();
$a = $document->createElement('a');
$b = $document->createElement('b');
$c = $document->createElement('c');
$a->appendChild($b);
$b->appendChild($c);
try {
$b->replaceChild($a, $c);
} catch (DOMException $e) {
echo "DOMException: " . $e->getMessage();
}
?>
--EXPECT--
DOMException: Hierarchy Request Error