1--TEST--
2Dom\Node::$nodeName
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8echo "--- For HTML document ---\n";
9
10$dom = Dom\HTMLDocument::createEmpty();
11
12$dom->appendChild($dom->createElement('container'));
13var_dump($dom->createAttributeNS('http://www.w3.org/1999/xhtml', 'html')->nodeName);
14var_dump($dom->createAttributeNS('http://www.w3.org/1999/xhtml', 'foo:html')->nodeName);
15
16echo "\n";
17
18var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml', 'html')->nodeName);
19var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml/', 'html')->nodeName);
20var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml', 'foo:html')->nodeName);
21var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml/', 'foo:html')->nodeName);
22var_dump($dom->createElementNS('', 'html')->nodeName);
23var_dump($dom->createElementNS(null, 'html')->nodeName);
24
25echo "--- For XML document ---\n";
26
27$dom = Dom\XMLDocument::createEmpty();
28
29$dom->appendChild($dom->createElement('container'));
30var_dump($dom->createAttributeNS('http://www.w3.org/1999/xhtml', 'html')->nodeName);
31var_dump($dom->createAttributeNS('http://www.w3.org/1999/xhtml', 'foo:html')->nodeName);
32
33echo "\n";
34
35var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml', 'html')->nodeName);
36var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml/', 'html')->nodeName);
37var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml', 'foo:html')->nodeName);
38var_dump($dom->createElementNS('http://www.w3.org/1999/xhtml/', 'foo:html')->nodeName);
39var_dump($dom->createElementNS('', 'html')->nodeName);
40var_dump($dom->createElementNS(null, 'html')->nodeName);
41?>
42--EXPECT--
43--- For HTML document ---
44string(4) "html"
45string(8) "foo:html"
46
47string(4) "HTML"
48string(4) "html"
49string(8) "FOO:HTML"
50string(8) "foo:html"
51string(4) "html"
52string(4) "html"
53--- For XML document ---
54string(4) "html"
55string(8) "foo:html"
56
57string(4) "html"
58string(4) "html"
59string(8) "foo:html"
60string(8) "foo:html"
61string(4) "html"
62string(4) "html"
63