]> granicus.if.org Git - php/commitdiff
Fix tests (closes #45841)
authorArnaud Le Blanc <lbarnaud@php.net>
Mon, 18 Aug 2008 04:45:25 +0000 (04:45 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Mon, 18 Aug 2008 04:45:25 +0000 (04:45 +0000)
ext/standard/tests/dir/readdir_variation2.phpt
ext/standard/tests/dir/rewinddir_variation2.phpt

index 84742984b152048717b286bd5c10a76ef4ffadcc..a1318e5975ca7d8a2cb10f14b500492b13e8dc65 100644 (file)
@@ -18,11 +18,20 @@ mkdir($path);
 $dir_handle = opendir($path);
 
 echo "\n-- Pass an empty directory to readdir() --\n";
+function mysort($a,$b) {
+       return strlen($a) > strlen($b) ? 1 : -1;
+}
+$entries = array();
 while(FALSE !== ($file = readdir($dir_handle))){
-       var_dump($file);
+       $entries[] = $file;
 }
 
 closedir($dir_handle);
+
+usort($entries, "mysort");
+foreach($entries as $entry) {
+       var_dump($entry);
+}
 ?>
 ===DONE===
 --CLEAN--
index 09fb40ea018be4fba7cf995e8049ead8403c3e00..092839e497a3dc089a2d749529bce2ef016d6f26 100644 (file)
@@ -36,7 +36,7 @@ rmdir($dir_path);
 
 -- Create the directory handle, read and close the directory --
 resource(%d) of type (stream)
-unicode(1) "."
+unicode(%d) "%s"
 
 -- Call to rewinddir() --