From d14f23365cda4e830aa09fcf1d64c07c4fde21c9 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 1 May 2012 15:43:31 -0700 Subject: Make output order for dom007.phpt platform independent This test has long been near the top of the reported output diffs. For example, on http://qa.php.net/reports/?version=5.4.0 it has diffed 1307 times out of 3543 reports, at time of this commit. (The second highest diff has occurred 710 times.) --- ext/dom/tests/dom007.phpt | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/ext/dom/tests/dom007.phpt b/ext/dom/tests/dom007.phpt index 649d630336..5d12aa344d 100644 --- a/ext/dom/tests/dom007.phpt +++ b/ext/dom/tests/dom007.phpt @@ -63,12 +63,24 @@ echo "\n"; $ents = $dtd->entities; $length = $ents->length; echo "Length: ".$length."\n"; + +$xkeys = array(); foreach ($ents AS $key=>$node) { - echo "Key: $key Name: ".$node->nodeName."\n"; + $xkeys[] = "Key: $key Name: ".$node->nodeName."\n"; +} +sort($xkeys); // fix inconsistent output ordering (bug #61810) +foreach ($xkeys as $key => $node) { + echo $node; } echo "\n"; + +$xkeys = array(); for($x=0; $x < $length; $x++) { - echo "Index $x: ".$ents->item($x)->nodeName."\n"; + $xkeys[] = "Index: ".$ents->item($x)->nodeName."\n"; +} +sort($xkeys); // fix inconsistent output ordering (bug #61810) +foreach ($xkeys as $key => $node) { + echo $node; } echo "\n"; @@ -87,13 +99,13 @@ Index 0: GIF (image/gif) (-) NULL Length: 3 -Key: test Name: test -Key: rdf Name: rdf Key: myimage Name: myimage +Key: rdf Name: rdf +Key: test Name: test -Index 0: test -Index 1: rdf -Index 2: myimage +Index: myimage +Index: rdf +Index: test NULL NULL -- cgit v1.2.1