From 794955ce856e73b4893f63963718548e5cc7ab0d Mon Sep 17 00:00:00 2001 From: Josie Messa Date: Mon, 10 Mar 2008 14:12:41 +0000 Subject: - New tests for scandir() function --- ext/standard/tests/dir/scandir_basic.phpt | 70 ++++++ ext/standard/tests/dir/scandir_error1.phpt | 47 ++++ ext/standard/tests/dir/scandir_error2.phpt | 41 ++++ ext/standard/tests/dir/scandir_variation1.phpt | 253 ++++++++++++++++++++++ ext/standard/tests/dir/scandir_variation2.phpt | 283 +++++++++++++++++++++++++ ext/standard/tests/dir/scandir_variation3.phpt | 238 +++++++++++++++++++++ ext/standard/tests/dir/scandir_variation4.phpt | 169 +++++++++++++++ ext/standard/tests/dir/scandir_variation5.phpt | 98 +++++++++ ext/standard/tests/dir/scandir_variation6.phpt | 70 ++++++ ext/standard/tests/dir/scandir_variation7.phpt | 169 +++++++++++++++ ext/standard/tests/dir/scandir_variation8.phpt | 154 ++++++++++++++ ext/standard/tests/dir/scandir_variation9.phpt | 72 +++++++ 12 files changed, 1664 insertions(+) create mode 100644 ext/standard/tests/dir/scandir_basic.phpt create mode 100644 ext/standard/tests/dir/scandir_error1.phpt create mode 100644 ext/standard/tests/dir/scandir_error2.phpt create mode 100644 ext/standard/tests/dir/scandir_variation1.phpt create mode 100644 ext/standard/tests/dir/scandir_variation2.phpt create mode 100644 ext/standard/tests/dir/scandir_variation3.phpt create mode 100644 ext/standard/tests/dir/scandir_variation4.phpt create mode 100644 ext/standard/tests/dir/scandir_variation5.phpt create mode 100644 ext/standard/tests/dir/scandir_variation6.phpt create mode 100644 ext/standard/tests/dir/scandir_variation7.phpt create mode 100644 ext/standard/tests/dir/scandir_variation8.phpt create mode 100644 ext/standard/tests/dir/scandir_variation9.phpt (limited to 'ext/standard/tests/dir') diff --git a/ext/standard/tests/dir/scandir_basic.phpt b/ext/standard/tests/dir/scandir_basic.phpt new file mode 100644 index 0000000000..25700a7a4f --- /dev/null +++ b/ext/standard/tests/dir/scandir_basic.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test scandir() function : basic functionality +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : basic functionality *** + +-- scandir() with mandatory arguments -- +array(5) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(9) "file1.tmp" + [3]=> + string(9) "file2.tmp" + [4]=> + string(9) "file3.tmp" +} + +-- scandir() with all arguments -- +array(5) { + [0]=> + string(9) "file3.tmp" + [1]=> + string(9) "file2.tmp" + [2]=> + string(9) "file1.tmp" + [3]=> + string(2) ".." + [4]=> + string(1) "." +} +===DONE=== diff --git a/ext/standard/tests/dir/scandir_error1.phpt b/ext/standard/tests/dir/scandir_error1.phpt new file mode 100644 index 0000000000..7fbffba0cc --- /dev/null +++ b/ext/standard/tests/dir/scandir_error1.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test scandir() function : error conditions - Incorrect number of args +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : error conditions *** + +-- Testing scandir() function with Zero arguments -- + +Warning: scandir() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing scandir() function with more than expected no. of arguments -- + +Warning: scandir() expects at most 3 parameters, 4 given in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/dir/scandir_error2.phpt b/ext/standard/tests/dir/scandir_error2.phpt new file mode 100644 index 0000000000..1e99a578ac --- /dev/null +++ b/ext/standard/tests/dir/scandir_error2.phpt @@ -0,0 +1,41 @@ +--TEST-- +Test scandir() function : error conditions - Non-existent directory +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing scandir() : error conditions *** + +-- Pass scandir() an absolute path that does not exist -- + +Warning: scandir(%s/idonotexist): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Pass scandir() a relative path that does not exist -- + +Warning: scandir(/idonotexist): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation1.phpt b/ext/standard/tests/dir/scandir_variation1.phpt new file mode 100644 index 0000000000..84b3565f7e --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation1.phpt @@ -0,0 +1,253 @@ +--TEST-- +Test scandir() function : usage variations - different data types as $dir arg +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- Iteration 1 -- + +Warning: scandir(0): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: scandir(1): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: scandir(12345): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: scandir(-2345): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: scandir(10.5): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: scandir(-10.5): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: scandir(123456789000): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: scandir(1.23456789E-9): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: scandir(0.5): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: scandir(1): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: scandir(1): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 18 -- + +Warning: scandir() expects parameter 1 to be string, array given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: scandir(string): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 20 -- + +Warning: scandir(string): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 21 -- + +Warning: scandir(hello world): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 22 -- + +Warning: scandir(Class A object): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: scandir(): Directory name cannot be empty in %s on line %d +bool(false) + +-- Iteration 25 -- + +Warning: scandir() expects parameter 1 to be string, resource given in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation2.phpt b/ext/standard/tests/dir/scandir_variation2.phpt new file mode 100644 index 0000000000..e6033f256c --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation2.phpt @@ -0,0 +1,283 @@ +--TEST-- +Test scandir() function : usage variations - diff data types as $sorting_order arg +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- Iteration 1 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 2 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 3 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 4 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 5 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 6 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 7 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 8 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 9 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 10 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 11 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 12 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 13 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 14 -- +array(2) { + [0]=> + string(2) ".." + [1]=> + string(1) "." +} + +-- Iteration 15 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 16 -- + +Warning: scandir() expects parameter 2 to be long, string given in %s on line %d +NULL + +-- Iteration 17 -- + +Warning: scandir() expects parameter 2 to be long, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: scandir() expects parameter 2 to be long, array given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: scandir() expects parameter 2 to be long, string given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: scandir() expects parameter 2 to be long, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: scandir() expects parameter 2 to be long, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: scandir() expects parameter 2 to be long, object given in %s on line %d +NULL + +-- Iteration 23 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 24 -- +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 25 -- + +Warning: scandir() expects parameter 2 to be long, resource given in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation3.phpt b/ext/standard/tests/dir/scandir_variation3.phpt new file mode 100644 index 0000000000..8e23faf2d4 --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation3.phpt @@ -0,0 +1,238 @@ +--TEST-- +Test scandir() function : usage variations - diff data types as $context arg +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- Iteration 1 -- + +Warning: scandir() expects parameter 3 to be resource, integer given in %s on line %d +NULL + +-- Iteration 2 -- + +Warning: scandir() expects parameter 3 to be resource, integer given in %s on line %d +NULL + +-- Iteration 3 -- + +Warning: scandir() expects parameter 3 to be resource, integer given in %s on line %d +NULL + +-- Iteration 4 -- + +Warning: scandir() expects parameter 3 to be resource, integer given in %s on line %d +NULL + +-- Iteration 5 -- + +Warning: scandir() expects parameter 3 to be resource, double given in %s on line %d +NULL + +-- Iteration 6 -- + +Warning: scandir() expects parameter 3 to be resource, double given in %s on line %d +NULL + +-- Iteration 7 -- + +Warning: scandir() expects parameter 3 to be resource, double given in %s on line %d +NULL + +-- Iteration 8 -- + +Warning: scandir() expects parameter 3 to be resource, double given in %s on line %d +NULL + +-- Iteration 9 -- + +Warning: scandir() expects parameter 3 to be resource, double given in %s on line %d +NULL + +-- Iteration 10 -- + +Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d +NULL + +-- Iteration 11 -- + +Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d +NULL + +-- Iteration 12 -- + +Warning: scandir() expects parameter 3 to be resource, boolean given in %s on line %d +NULL + +-- Iteration 13 -- + +Warning: scandir() expects parameter 3 to be resource, boolean given in %s on line %d +NULL + +-- Iteration 14 -- + +Warning: scandir() expects parameter 3 to be resource, boolean given in %s on line %d +NULL + +-- Iteration 15 -- + +Warning: scandir() expects parameter 3 to be resource, boolean given in %s on line %d +NULL + +-- Iteration 16 -- + +Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d +NULL + +-- Iteration 17 -- + +Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: scandir() expects parameter 3 to be resource, array given in %s on line %d +NULL + +-- Iteration 19 -- + +Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d +NULL + +-- Iteration 20 -- + +Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d +NULL + +-- Iteration 21 -- + +Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d +NULL + +-- Iteration 22 -- + +Warning: scandir() expects parameter 3 to be resource, object given in %s on line %d +NULL + +-- Iteration 23 -- + +Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d +NULL + +-- Iteration 24 -- + +Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d +NULL + +-- Iteration 25 -- + +Warning: scandir(): supplied resource is not a valid Stream-Context resource in %s on line %d +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation4.phpt b/ext/standard/tests/dir/scandir_variation4.phpt new file mode 100644 index 0000000000..f756cf1ee6 --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation4.phpt @@ -0,0 +1,169 @@ +--TEST-- +Test scandir() function : usage variations - different relative paths +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- $path = './level_one': -- +bool(true) +array(5) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_one1.tmp" + [3]=> + string(14) "level_one2.tmp" + [4]=> + string(9) "level_two" +} + +-- $path = 'level_one/level_two': -- +bool(true) +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_two1.tmp" + [3]=> + string(14) "level_two2.tmp" +} + +-- $path = '..': -- +bool(true) +array(5) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_one1.tmp" + [3]=> + string(14) "level_one2.tmp" + [4]=> + string(9) "level_two" +} + +-- $path = 'level_two', '.': -- +bool(true) +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_two1.tmp" + [3]=> + string(14) "level_two2.tmp" +} + +-- $path = '../': -- +bool(true) +array(5) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_one1.tmp" + [3]=> + string(14) "level_one2.tmp" + [4]=> + string(9) "level_two" +} + +-- $path = './': -- +bool(true) +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_two1.tmp" + [3]=> + string(14) "level_two2.tmp" +} + +-- $path = '../../'level_one': -- +bool(true) +array(5) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(14) "level_one1.tmp" + [3]=> + string(14) "level_one2.tmp" + [4]=> + string(9) "level_two" +} +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation5.phpt b/ext/standard/tests/dir/scandir_variation5.phpt new file mode 100644 index 0000000000..d6d3c79e40 --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation5.phpt @@ -0,0 +1,98 @@ +--TEST-- +Test scandir() function : usage variations - different directory permissions +--SKIPIF-- + +--FILE-- + sub_dir ( sub parent ) + * |-> child_dir ( child dir) + */ + +$parent_dir_path = dirname(__FILE__) . "/scandir_variation5"; +mkdir($parent_dir_path); +chmod($parent_dir_path, 0777); + +// create sub_dir +$sub_dir_path = $parent_dir_path . "/sub_dir"; +mkdir($sub_dir_path); +chmod($sub_dir_path, 0777); + +//create sub_sub_dir +$child_dir_path = $sub_dir_path."/child_dir"; +mkdir($child_dir_path); + +// remove the write and execute permisson from sub parent +chmod($sub_dir_path, 0444); + +echo "\n-- After restricting 1st level parent directory --\n"; +var_dump(scandir($child_dir_path)); + +// remove the execute permisson from parent dir, allowing all permission for sub dir +chmod($sub_dir_path, 0777); // all permisson to sub dir +chmod($parent_dir_path, 0666); // restricting parent directory + +echo "\n-- After restricting parent directory --\n"; +var_dump(scandir($child_dir_path)); +?> +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- After restricting 1st level parent directory -- + +Warning: scandir(%s/scandir_variation5/sub_dir/child_dir): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- After restricting parent directory -- + +Warning: scandir(%s/scandir_variation5/sub_dir/child_dir): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation6.phpt b/ext/standard/tests/dir/scandir_variation6.phpt new file mode 100644 index 0000000000..5cb595fe75 --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation6.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test scandir() function : usage variations - Wildcards in directory path +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- Wildcard = '*' -- + +Warning: scandir(%s/scandir_var*): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +Warning: scandir(%s/*): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +-- Wildcard = '?' -- + +Warning: scandir(%s/scandir_variation6/sub_dir?): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) + +Warning: scandir(%s/scandir_variation6/sub?dir1): failed to open dir: %s in %s on line %d + +Warning: scandir(): (errno %d): %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation7.phpt b/ext/standard/tests/dir/scandir_variation7.phpt new file mode 100644 index 0000000000..c7f77651d3 --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation7.phpt @@ -0,0 +1,169 @@ +--TEST-- +Test scandir() function : usage variations - different directory permissions +--SKIPIF-- + +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- Iteration 1 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 2 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 3 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 4 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 5 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 6 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 7 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 8 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 9 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} + +-- Iteration 10 -- +bool(true) +array(2) { + [0]=> + string(1) "." + [1]=> + string(2) ".." +} +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation8.phpt b/ext/standard/tests/dir/scandir_variation8.phpt new file mode 100644 index 0000000000..36ae88c8f5 --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation8.phpt @@ -0,0 +1,154 @@ +--TEST-- +Test scandir() function : usage variations - different file names +--FILE-- + $input) { + echo "\n-- Iteration $iterator --\n"; + $handle = "fp{$iterator}"; + var_dump( $$handle = fopen($dir_path . $input . '.tmp', 'w') ); + fclose($$handle); + $iterator++; +}; + +echo "\n-- Call to scandir() --\n"; +var_dump($content = scandir($dir_path)); + +// remove all files in directory so can remove directory in CLEAN section +foreach ($content as $file_name) { + // suppress errors as won't be able to remove "." and ".." entries + @unlink($dir_path . $file_name); +} +?> +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** + +-- Iteration 1 -- +resource(%d) of type (stream) + +-- Iteration 2 -- +resource(%d) of type (stream) + +-- Iteration 3 -- +resource(%d) of type (stream) + +-- Iteration 4 -- +resource(%d) of type (stream) + +-- Iteration 5 -- +resource(%d) of type (stream) + +-- Iteration 6 -- +resource(%d) of type (stream) + +-- Iteration 7 -- +resource(%d) of type (stream) + +-- Iteration 8 -- +resource(%d) of type (stream) + +-- Iteration 9 -- +resource(%d) of type (stream) + +-- Iteration 10 -- +resource(%d) of type (stream) + +-- Iteration 11 -- +resource(%d) of type (stream) + +-- Iteration 12 -- +resource(%d) of type (stream) + +-- Iteration 13 -- +resource(%d) of type (stream) + +-- Iteration 14 -- +resource(%d) of type (stream) + +-- Call to scandir() -- +array(16) { + [0]=> + string(9) "-10.5.tmp" + [1]=> + string(9) "-2345.tmp" + [2]=> + string(1) "." + [3]=> + string(2) ".." + [4]=> + string(4) ".tmp" + [5]=> + string(7) "0.5.tmp" + [6]=> + string(5) "0.tmp" + [7]=> + string(17) "1.23456789E-9.tmp" + [8]=> + string(5) "1.tmp" + [9]=> + string(8) "10.5.tmp" + [10]=> + string(9) "12345.tmp" + [11]=> + string(16) "123456789000.tmp" + [12]=> + string(9) "Array.tmp" + [13]=> + string(15) "double_file.tmp" + [14]=> + string(11) "hd_file.tmp" + [15]=> + string(15) "single_file.tmp" +} +===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation9.phpt b/ext/standard/tests/dir/scandir_variation9.phpt new file mode 100644 index 0000000000..2b1904c98f --- /dev/null +++ b/ext/standard/tests/dir/scandir_variation9.phpt @@ -0,0 +1,72 @@ +--TEST-- +Test scandir() function : usage variations - different ints as $sorting_order arg +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing scandir() : usage variations *** +array(4) { + [0]=> + string(9) "file2.tmp" + [1]=> + string(9) "file1.tmp" + [2]=> + string(2) ".." + [3]=> + string(1) "." +} +array(4) { + [0]=> + string(9) "file2.tmp" + [1]=> + string(9) "file1.tmp" + [2]=> + string(2) ".." + [3]=> + string(1) "." +} +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(9) "file1.tmp" + [3]=> + string(9) "file2.tmp" +} +===DONE=== -- cgit v1.2.1