diff --git a/hphp/test/slow/dom_document/1676.php b/hphp/test/slow/dom_document/1676.php index 3ac26b51e..423a11133 100644 --- a/hphp/test/slow/dom_document/1676.php +++ b/hphp/test/slow/dom_document/1676.php @@ -1,6 +1,5 @@ doctype; /* Notation Tests */ $nots = $dtd->notations; -$length = $nots->length; var_dump($length); -echo "Length: ".$length." -"; +$length = $nots->length; +var_dump($length); +echo "Length: ".$length."\n"; foreach ($nots AS $key=>$node) { - echo "Key $key: ".$node->nodeName." (". -$node->systemId.") (".$node->publicId.") -"; + echo "Key $key: ".$node->nodeName." (". + $node->systemId.") (".$node->publicId.")\n"; } print " "; for($x=0; $x < $length; $x++) { - echo "Index $x: ".$nots->item($x)->nodeName." (". - $nots->item($x)->systemId.") (".$nots->item($x)->publicId.") -"; + echo "Index $x: ".$nots->item($x)->nodeName." (". + $nots->item($x)->systemId.") (".$nots->item($x)->publicId.")\n"; } -echo " -"; +echo "\n"; $node = $nots->getNamedItem('xxx'); var_dump($node); -echo " -"; +echo "\n"; /* Entity Decl Tests */ $ents = $dtd->entities; -$length = $ents->length; -echo "Length: ".$length." -"; -foreach ($ents AS $key=>$node) { - echo "Key: $key Name: ".$node->nodeName." -"; -} -echo " -"; -for($x=0; $x < $length; $x++) { - echo "Index $x: ".$ents->item($x)->nodeName." -"; -} -echo " -"; -$node = $ents->item(3); -var_dump($node); +$length = $ents->length; +echo "Length: ".$length."\n"; + +$a = array(); +foreach ($ents AS $key=>$node) { + $a[$key] = $node; +} +ksort($a); + +foreach ($a as $key => $node) { + echo "Key: $key Name: ".$node->nodeName."\n"; +} +echo "\n"; + $node = $ents->getNamedItem('xxx'); var_dump($node); diff --git a/hphp/test/slow/dom_document/1676.php.expect b/hphp/test/slow/dom_document/1676.php.expect index c0b5d17bb..a57159690 100644 --- a/hphp/test/slow/dom_document/1676.php.expect +++ b/hphp/test/slow/dom_document/1676.php.expect @@ -7,13 +7,8 @@ Index 0: GIF (image/gif) (-) NULL Length: 3 -Key: test Name: test -Key: rdf Name: rdf Key: myimage Name: myimage - -Index 0: test -Index 1: rdf -Index 2: myimage +Key: rdf Name: rdf +Key: test Name: test NULL -NULL