1--TEST-- 2DOMNode::insertBefore() should fail if node belongs to another document 3--CREDITS-- 4Knut Urdalen <knut@php.net> 5--SKIPIF-- 6<?php require_once('skipif.inc'); ?> 7--FILE-- 8<?php 9 10$doc1 = new DOMDocument(); 11$doc2 = new DOMDocument(); 12 13$node_in_doc1 = $doc1->createElement("foo"); 14$node_in_doc2 = $doc2->createElement("bar"); 15 16try { 17 $node_in_doc2->insertBefore($node_in_doc1); 18} catch(DOMException $e) { 19 echo $e->getMessage(); 20} 21 22?> 23--EXPECTF-- 24Wrong Document Error 25