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