summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2012-05-01 15:43:31 -0700
committerChristopher Jones <sixd@php.net>2012-05-01 15:43:31 -0700
commitd14f23365cda4e830aa09fcf1d64c07c4fde21c9 (patch)
tree03d3ca4058c2ddf51cdfa3d49efdb6ad5ac331a8
parent02e25df8b5a7c60364c7153c03da59de3a556a87 (diff)
downloadphp-git-d14f23365cda4e830aa09fcf1d64c07c4fde21c9.tar.gz
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.)
-rw-r--r--ext/dom/tests/dom007.phpt26
1 files 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