1--TEST--
2Document::append() with text nodes in an invalid hierarchy
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\HTMLDocument::createEmpty();
9
10try {
11    $dom->append("foo", "bar", "baz", $dom);
12} catch (DOMException $e) {
13    echo $e->getMessage(), "\n";
14}
15
16try {
17    $dom->append("foo", "bar", "baz");
18} catch (DOMException $e) {
19    echo $e->getMessage(), "\n";
20}
21
22var_dump($dom->saveHtml());
23
24?>
25--EXPECT--
26Hierarchy Request Error
27Cannot insert text as a child of a document
28string(0) ""
29