1--TEST--
2DOMNode::getRootNode()
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = new DOMDocument();
9$dom->loadXML('<?xml version="1.0"?><html><body/></html>');
10
11var_dump($dom->documentElement->firstElementChild->getRootNode() === $dom);
12$p = $dom->createElement('p');
13var_dump($p->getRootNode() === $p);
14$dom->documentElement->appendChild($p);
15var_dump($p->getRootNode() === $dom);
16$dom->documentElement->remove();
17var_dump($p->getRootNode() === $p);
18
19$fragment = $dom->createDocumentFragment();
20var_dump($fragment->getRootNode() === $fragment);
21$div = $fragment->appendChild($dom->createElement('div'));
22$div->appendChild($p);
23var_dump($p->getRootNode() === $fragment);
24
25?>
26--EXPECT--
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31bool(true)
32bool(true)
33