diff options
| author | Dmitry Stogov <dmitry@php.net> | 2008-03-24 09:00:18 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2008-03-24 09:00:18 +0000 |
| commit | 193801fbdafbeb3dcb7ba67d5b679880dc8a32de (patch) | |
| tree | 3fadb98e5e79368cad4eb940cdf37f22cdbcd28d /ext/standard | |
| parent | 7e071024d3e91f998359fd1f49982d71f463e79e (diff) | |
| download | php-git-193801fbdafbeb3dcb7ba67d5b679880dc8a32de.tar.gz | |
Fixed tests (file order is undefined, so we need to sort() them)
Diffstat (limited to 'ext/standard')
| -rw-r--r-- | ext/standard/tests/dir/readdir_basic.phpt | 10 | ||||
| -rw-r--r-- | ext/standard/tests/dir/readdir_variation6.phpt | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ext/standard/tests/dir/readdir_basic.phpt b/ext/standard/tests/dir/readdir_basic.phpt index 7afdc42f3c..572a9a0799 100644 --- a/ext/standard/tests/dir/readdir_basic.phpt +++ b/ext/standard/tests/dir/readdir_basic.phpt @@ -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); } diff --git a/ext/standard/tests/dir/readdir_variation6.phpt b/ext/standard/tests/dir/readdir_variation6.phpt index 2c76650708..eec673e73c 100644 --- a/ext/standard/tests/dir/readdir_variation6.phpt +++ b/ext/standard/tests/dir/readdir_variation6.phpt @@ -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); } |
