1--TEST--
2Dom\Node::isEqualNode edge cases 02
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\HTMLDocument::createEmpty();
9$dom->append($dom->createElement("container"));
10$e1 = $dom->documentElement->appendChild($dom->createElement("foo1"));
11$e1->after("\n");
12$e2 = $dom->documentElement->appendChild($dom->createElement("foo2"));
13
14$e2->setAttribute("bar1", "baz");
15$e2->setAttribute("bar2", "baz");
16// Internal namespace node creation
17$e2->setAttributeNodeNS($child = $dom->createAttributeNS("http://example.com", "foo:bar"));
18$e2->removeAttributeNode($child);
19
20$dom2 = Dom\HTMLDocument::createFromString("<!DOCTYPE HTML>" . $dom->saveHtml());
21
22var_dump($dom->saveHtml($dom->getElementsByTagName("container")[0]));
23var_dump($dom2->saveHtml($dom2->getElementsByTagName("container")[0]));
24var_dump($dom->getElementsByTagName("container")[0]->isEqualNode($dom2->getElementsByTagName("container")[0]));
25
26?>
27--EXPECT--
28string(72) "<container><foo1></foo1>
29<foo2 bar1="baz" bar2="baz"></foo2></container>"
30string(72) "<container><foo1></foo1>
31<foo2 bar1="baz" bar2="baz"></foo2></container>"
32bool(true)
33