xref: /php-src/ext/dom/tests/modern/spec/gh11404_1.phpt (revision 6e7adb3c)
1--TEST--
2GH-11404 (DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom1 = Dom\XMLDocument::createFromString('<?xml version="1.0"?><with xmlns="some:ns" />');
9
10$nodeA = $dom1->createElement('none');
11$nodeB = $dom1->createElementNS(null, 'none');
12
13$dom1->documentElement->appendChild($nodeA);
14$dom1->documentElement->appendChild($nodeB);
15
16echo $dom1->saveXml(), "\n";
17
18var_dump($nodeA->namespaceURI, $nodeB->namespaceURI);
19
20?>
21--EXPECT--
22<?xml version="1.0" encoding="UTF-8"?>
23<with xmlns="some:ns"><none xmlns=""/><none xmlns=""/></with>
24NULL
25NULL
26