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

index 6809ac2f255b19043790b96ba3329dbb00cd812c..c689ed90eee5d68cbd13aa7c7517bdfbfa3b25ea 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 37ff324ee284b8f794341d6705dc4e147939ee68..7594cc220e8b705791c73d58e550b8918c313876 100644 (file)
@@ -36,7 +36,7 @@ rmdir($dir_path);
 
 -- Create the directory handle, read and close the directory --
 resource(%d) of type (stream)
-string(1) "."
+string(%d) "%s"
 
 -- Call to rewinddir() --