File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / dom / tests / DOMNode_insertBefore_error1.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:54 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
DOMNode::insertBefore() should fail if node belongs to another document
--CREDITS--
Knut Urdalen <knut@php.net>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php

$doc1 = new DOMDocument();
$doc2 = new DOMDocument();

$node_in_doc1 = $doc1->createElement("foo");
$node_in_doc2 = $doc2->createElement("bar");

try {
	$node_in_doc2->insertBefore($node_in_doc1);
} catch(DOMException $e) {
	echo $e->getMessage();
}

?>
--EXPECTF--
Wrong Document Error

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>