dmitry Mon Mar 24 09:00:41 2008 UTC Modified files: /php-src/ext/standard/tests/dir readdir_basic.phpt readdir_variation6.phpt Log: Fixed tests (file order is undefined, so we need to sort() them) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/dir/readdir_basic.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/dir/readdir_basic.phpt diff -u php-src/ext/standard/tests/dir/readdir_basic.phpt:1.2 php-src/ext/standard/tests/dir/readdir_basic.phpt:1.3 --- php-src/ext/standard/tests/dir/readdir_basic.phpt:1.2 Tue Mar 4 17:11:10 2008 +++ php-src/ext/standard/tests/dir/readdir_basic.phpt Mon Mar 24 09:00:41 2008 @@ -22,13 +22,23 @@ 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); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/dir/readdir_variation6.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/dir/readdir_variation6.phpt diff -u php-src/ext/standard/tests/dir/readdir_variation6.phpt:1.2 php-src/ext/standard/tests/dir/readdir_variation6.phpt:1.3 --- php-src/ext/standard/tests/dir/readdir_variation6.phpt:1.2 Tue Mar 4 17:11:10 2008 +++ php-src/ext/standard/tests/dir/readdir_variation6.phpt Mon Mar 24 09:00:41 2008 @@ -14,15 +14,15 @@ echo "*** Testing readdir() : usage variations ***\n"; - -include( dirname(__FILE__) . "/../file/file.inc"); +// include the file.inc for Function: function create_files() +include( dirname(__FILE__)."/../file/file.inc"); // create the temporary directory $dir_path = dirname(__FILE__) . "/readdir_variation6"; mkdir($dir_path); // create files within the temporary directory [EMAIL PROTECTED]($dir_path, 3, "alphanumeric", 0755, 1, "w", "readdir_variation6"); +create_files($dir_path, 3, "alphanumeric", 0755, 1, "w", "readdir_variation6"); // open the directory $dir_handle1 = opendir($dir_path); @@ -31,12 +31,22 @@ 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); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php