From: Josie Messa Date: Fri, 7 Mar 2008 16:00:24 +0000 (+0000) Subject: - New tests for closedir() function X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~682 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37ca3ca2b53d8fa46081e3b9229f7f9f2e1c049f;p=php - New tests for closedir() function --- diff --git a/ext/standard/tests/dir/closedir_basic.phpt b/ext/standard/tests/dir/closedir_basic.phpt new file mode 100644 index 0000000000..f58bfca8f1 --- /dev/null +++ b/ext/standard/tests/dir/closedir_basic.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test closedir() function : basic functionality +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing closedir() : basic functionality *** + +-- Call closedir() with no arguments: -- +NULL +-- Check Directory Handle: -- +resource(%d) of type (Unknown) + +-- Call closedir() with $dir_handle argument supplied: -- +NULL +-- Check Directory Handle: -- +resource(%d) of type (Unknown) +===DONE=== diff --git a/ext/standard/tests/dir/closedir_error.phpt b/ext/standard/tests/dir/closedir_error.phpt new file mode 100644 index 0000000000..1a8a043d0a --- /dev/null +++ b/ext/standard/tests/dir/closedir_error.phpt @@ -0,0 +1,45 @@ +--TEST-- +Test closedir() function : error conditions - Pass incorrect number of arguments +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing closedir() : error conditions *** + +-- Testing closedir() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for closedir() in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/dir/closedir_variation1.phpt b/ext/standard/tests/dir/closedir_variation1.phpt new file mode 100644 index 0000000000..d5c843996d --- /dev/null +++ b/ext/standard/tests/dir/closedir_variation1.phpt @@ -0,0 +1,212 @@ +--TEST-- +Test closedir() function : usage variations - different data types as $dir_handle arg +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing closedir() : usage variations *** + +-- Iteration 1 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 2 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 3 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 4 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 5 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 7 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 8 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 9 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 10 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 11 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 12 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 13 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 14 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 15 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 16 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 17 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 18 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 19 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 20 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 21 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 22 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 23 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) + +-- Iteration 24 -- + +Warning: closedir(): supplied argument is not a valid Directory resource in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/dir/closedir_variation2.phpt b/ext/standard/tests/dir/closedir_variation2.phpt new file mode 100644 index 0000000000..015176c84d --- /dev/null +++ b/ext/standard/tests/dir/closedir_variation2.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test closedir() function : usage variations - close directory handle twice +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECTF-- +*** Testing closedir() : usage variations *** + +-- Close directory handle first time: -- +NULL +Directory Handle: resource(%d) of type (Unknown) + +-- Close directory handle second time: -- + +Warning: closedir(): %d is not a valid Directory resource in %s on line %d +bool(false) +Directory Handle: resource(%d) of type (Unknown) +===DONE===