1--TEST-- 2DOMNode: isSameNode() 3--CREDITS-- 4James Lewis <james@s-1.com> 5#TestFest 2008 6--SKIPIF-- 7<?php require_once('skipif.inc'); ?> 8--FILE-- 9<?php 10require_once("dom_test.inc"); 11 12$dom = new DOMDocument; 13$dom->loadXML($xmlstr); 14if(!$dom) { 15 echo "Error while parsing the document\n"; 16 exit; 17} 18 19$node = $dom->documentElement; 20if($node->isSameNode($node)) 21 echo "EXPECTING SAME NODE, PASSED\n" ; 22else 23 echo "EXPECTING SAME NODE, FAILED\n" ; 24 25$nodelist=$dom->getElementsByTagName('tbody') ; 26 27if($nodelist->item(0)->isSameNode($node)) 28 echo "EXPECTING NOT SAME NODE, FAILED\n" ; 29else 30 echo "EXPECTING NOT SAME NODE, PASSED\n" ; 31 32?> 33===DONE=== 34--EXPECT-- 35EXPECTING SAME NODE, PASSED 36EXPECTING NOT SAME NODE, PASSED 37===DONE=== 38