]> granicus.if.org Git - php/commitdiff
MFB: Fixed test on systems where . and .. order not guaranteed
authorIlia Alshanetsky <iliaa@php.net>
Mon, 24 Mar 2008 18:34:44 +0000 (18:34 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 24 Mar 2008 18:34:44 +0000 (18:34 +0000)
ext/standard/tests/dir/rewinddir_basic.phpt

index 13929250bbf8c6a3b8315c2af2725134f472ab6d..36a9f25e67f6b32ea4c5c966f4a6678b7b003fa8 100644 (file)
@@ -27,18 +27,24 @@ mkdir($dir_path2);
 var_dump($dh1 = opendir($dir_path1));
 var_dump($dh2 = opendir($dir_path2));
 
+$data = array();
 echo "\n-- Read and rewind first directory (argument supplied) --\n";
 while(FALSE !== $file1 = readdir($dh1)) {
-       var_dump($file1);
+       $data[] = $file1;
 }
+sort($data);
+var_dump($data);
 
 var_dump(rewinddir($dh1));
 var_dump(readdir($dh1));
 
+$data = array();
 echo "\n-- Read and rewind second directory (no argument supplied) --\n";
 while(FALSE !== $file2 = readdir()) {
-       var_dump($file2);
+       $data[] = $file2;
 }
+sort($data);
+var_dump($data);
 
 var_dump(rewinddir());
 var_dump(readdir());
@@ -63,16 +69,26 @@ resource(%d) of type (stream)
 resource(%d) of type (stream)
 
 -- Read and rewind first directory (argument supplied) --
-string(1) "."
-string(2) ".."
-string(9) "file1.tmp"
+array(3) {
+  [0]=>
+  string(1) "."
+  [1]=>
+  string(2) ".."
+  [2]=>
+  string(9) "file1.tmp"
+}
 NULL
 string(1) "."
 
 -- Read and rewind second directory (no argument supplied) --
-string(1) "."
-string(2) ".."
-string(9) "file2.tmp"
+array(3) {
+  [0]=>
+  string(1) "."
+  [1]=>
+  string(2) ".."
+  [2]=>
+  string(9) "file2.tmp"
+}
 NULL
 string(1) "."
 ===DONE===