]> granicus.if.org Git - php/commitdiff
Fixed tests (file order is undefined, so we need to sort() them)
authorDmitry Stogov <dmitry@php.net>
Mon, 24 Mar 2008 09:00:18 +0000 (09:00 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 24 Mar 2008 09:00:18 +0000 (09:00 +0000)
ext/standard/tests/dir/readdir_basic.phpt
ext/standard/tests/dir/readdir_variation6.phpt

index 7afdc42f3c799cf0c6b8f9673c0d08d95a75becf..572a9a07993c34b2f8319303068ec22e37d3b71a 100644 (file)
@@ -23,13 +23,23 @@ create_files($path, 3);
 
 echo "\n-- Call readdir() with \$path argument --\n";
 var_dump($dh = opendir($path));
+$a = array();
 while( FALSE !== ($file = readdir($dh)) ) {
+       $a[] = $file;
+}
+sort($a);
+foreach($a as $file) {
        var_dump($file);
 }
 
 echo "\n-- Call readdir() without \$path argument --\n";
 var_dump($dh = opendir($path));
+$a = array();
 while( FALSE !== ( $file = readdir() ) ) {
+       $a[] = $file;
+}
+sort($a);
+foreach($a as $file) {
        var_dump($file);
 }
 
index 2c766507081cba515071d23413ff50079bf62131..eec673e73c80d11485d022bf787c69785e3249f2 100644 (file)
@@ -31,12 +31,22 @@ $dir_handle1 = opendir($dir_path);
 opendir($dir_path);
 
 echo "\n-- Reading Directory Contents with Previous Handle --\n";
+$a = array();
 while (FALSE !== ($file = readdir($dir_handle1))) {
+       $a[] = $file;
+}
+sort($a);
+foreach ($a as $file) {
        var_dump($file);
 }
 
 echo "\n-- Reading Directory Contents with Current Handle (no arguments supplied) --\n";
+$a = array();
 while (FALSE !== ($file = readdir())) {
+       $a[] = $file;
+}
+sort($a);
+foreach ($a as $file) {
        var_dump($file);
 }