]> granicus.if.org Git - php/blob
e82d9ae034
[php] /
1 --TEST--
2 Test is_dir() function: usage variations - invalid arguments
3 --CONFLICTS--
4 obscure_filename
5 --FILE--
6 <?php
7 /* Prototype: bool is_dir ( string $dirname );
8    Description: Tells whether the dirname is a directory
9      Returns TRUE if the dirname exists and is a directory, FALSE  otherwise.
10 */
11
12 /* Passing invalid arguments to is_dir() */
13
14 echo "*** Testing is_dir() with Invalid arguments: expected bool(false) ***\n";
15 $dirnames = array(
16   /* Invalid dirnames */
17   -2.34555,
18   TRUE,
19   FALSE,
20   NULL,
21   " ",
22
23   /* scalars */
24   0,
25   1234
26 );
27
28 /* loop through to test each element the above array */
29 foreach($dirnames as $dirname) {
30   var_dump( is_dir($dirname) );
31 }
32 ?>
33 --EXPECTF--
34 *** Testing is_dir() with Invalid arguments: expected bool(false) ***
35 bool(false)
36 bool(false)
37 bool(false)
38 bool(false)
39 bool(false)
40 bool(false)
41 bool(false)