1--TEST--
2Appending should not merge text nodes
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\XMLDocument::createEmpty();
9$element = $dom->createElement("div");
10$span = $dom->createElement("span");
11$span->textContent = "qux";
12$element->append("foo", "bar", "baz", $span, $dom->createCDATASection("a"), $dom->createCDATASection("b"));
13$dom->append($element);
14echo $dom->saveXml(), "\n";
15
16var_dump($element->firstChild->textContent);
17var_dump($element->firstChild->nextSibling->textContent);
18var_dump($element->firstChild->nextSibling->nextSibling->textContent);
19
20$dom->normalize();
21echo $dom->saveXml(), "\n";
22
23var_dump($element->firstChild->textContent);
24var_dump($element->firstChild->nextSibling->textContent);
25
26?>
27--EXPECT--
28<?xml version="1.0" encoding="UTF-8"?>
29<div>foobarbaz<span>qux</span><![CDATA[a]]><![CDATA[b]]></div>
30string(3) "foo"
31string(3) "bar"
32string(3) "baz"
33<?xml version="1.0" encoding="UTF-8"?>
34<div>foobarbaz<span>qux</span><![CDATA[a]]><![CDATA[b]]></div>
35string(9) "foobarbaz"
36string(3) "qux"
37