Annotation of embedaddon/php/ext/standard/tests/file/is_dir_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test is_dir() function: basic functionality
3: --FILE--
4: <?php
5: /* Prototype: bool is_dir ( string $filename );
6: Description: Tells whether the filename is a regular file
7: Returns TRUE if the filename exists and is a regular file
8: */
9:
10: echo "*** Testing is_dir(): basic functionality ***\n";
11: $file_path = dirname(__FILE__);
12: var_dump( is_dir($file_path) );
13: clearstatcache();
14: var_dump( is_dir(".") );
15: var_dump( is_dir(__FILE__) ); // expected: bool(false)
16:
17: $dir_name = $file_path."/is_dir_basic";
18: mkdir($dir_name);
19: var_dump( is_dir($dir_name) );
20:
21: echo "*** Testing is_dir() for its return value type ***\n";
22: var_dump( is_bool( is_dir($file_path) ) );
23: var_dump( is_bool( is_dir("/no/such/dir") ) );
24:
25: echo "*** Done ***";
26: ?>
27: --CLEAN--
28: <?php
29: $file_path = dirname(__FILE__);
30: $dir_name = $file_path."/is_dir_basic";
31: rmdir($dir_name);
32: ?>
33:
34: --EXPECTF--
35: *** Testing is_dir(): basic functionality ***
36: bool(true)
37: bool(true)
38: bool(false)
39: bool(true)
40: *** Testing is_dir() for its return value type ***
41: bool(true)
42: bool(true)
43: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>