1--TEST--
2Consistency of parent node after exception in ParentNode::append()
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = Dom\XMLDocument::createEmpty();
8$fragment = $dom->createDocumentFragment();
9$fragment->append($element = $dom->createElement("foo"));
10$fragment->append($dom->createElement("bar"));
11try {
12    $dom->append($fragment);
13} catch (DOMException $e) {
14    echo "Exception: " . $e->getMessage() . "\n";
15}
16
17var_dump($element->parentNode);
18?>
19--EXPECT--
20Exception: Cannot have more than one element child in a document
21object(Dom\DocumentFragment)#2 (17) {
22  ["firstElementChild"]=>
23  string(22) "(object value omitted)"
24  ["lastElementChild"]=>
25  string(22) "(object value omitted)"
26  ["childElementCount"]=>
27  int(2)
28  ["nodeType"]=>
29  int(11)
30  ["nodeName"]=>
31  string(18) "#document-fragment"
32  ["baseURI"]=>
33  string(11) "about:blank"
34  ["isConnected"]=>
35  bool(false)
36  ["ownerDocument"]=>
37  string(22) "(object value omitted)"
38  ["parentNode"]=>
39  NULL
40  ["parentElement"]=>
41  NULL
42  ["childNodes"]=>
43  string(22) "(object value omitted)"
44  ["firstChild"]=>
45  string(22) "(object value omitted)"
46  ["lastChild"]=>
47  string(22) "(object value omitted)"
48  ["previousSibling"]=>
49  NULL
50  ["nextSibling"]=>
51  NULL
52  ["nodeValue"]=>
53  NULL
54  ["textContent"]=>
55  string(0) ""
56}
57