1--TEST--
2DOMParentNode::append() with DOMNode from wrong document throws exception
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7require_once("dom_test.inc");
8
9$dom1 = new DOMDocument;
10$dom1->loadXML('<test/>');
11
12$dom2 = new DOMDocument;
13$dom2->loadXML('<test><foo /></test>');
14
15$element = $dom1->documentElement;
16
17try {
18    $element->append($dom2->documentElement->firstChild);
19    echo "FAIL";
20} catch (DOMException $e) {
21    echo $e->getMessage() . "\n";
22}
23
24try {
25    $element->prepend($dom2->documentElement->firstChild);
26    echo "FAIL";
27} catch (DOMException $e) {
28    echo $e->getMessage();
29}
30?>
31--EXPECT--
32Wrong Document Error
33Wrong Document Error
34