Annotation of embedaddon/php/ext/standard/tests/file/is_dir_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test is_dir() function: usage variations - dir/subdir
3: --FILE--
4: <?php
5: /* Prototype: bool is_dir ( string $dirname );
6: Description: Tells whether the dirname is a directory
7: Returns TRUE if the dirname exists and is a directory, FALSE otherwise.
8: */
9:
10: /* Testing is_dir() with base and sub dirs */
11:
12: $file_path = dirname(__FILE__);
13:
14: echo "-- Testing is_dir() with an empty dir --\n";
15: $dirname = $file_path."/is_dir_variation1";
16: mkdir($dirname);
17: var_dump( is_dir($dirname) );
18: clearstatcache();
19:
20: echo "-- Testing is_dir() with a subdir in base dir --\n";
21: $subdirname = $dirname."/is_dir_variation1_sub";
22: mkdir($subdirname);
23: var_dump( is_dir($subdirname) );
24: var_dump( is_dir($dirname) );
25:
26: echo "\n*** Done ***";
27: ?>
28: --CLEAN--
29: <?php
30: $file_path = dirname(__FILE__);
31: $dir_name = $file_path."/is_dir_variation1";
32: rmdir($dir_name."/is_dir_variation1_sub");
33: rmdir($dir_name);
34: ?>
35: --EXPECTF--
36: -- Testing is_dir() with an empty dir --
37: bool(true)
38: -- Testing is_dir() with a subdir in base dir --
39: bool(true)
40: bool(true)
41:
42: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>