Return to is_dir_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test is_dir() function: error conditions 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() error conditions ***"; 11: var_dump( is_dir() ); // Zero No. of args 12: 13: $dir_name = dirname(__FILE__)."/is_dir_error"; 14: mkdir($dir_name); 15: var_dump( is_dir($dir_name, "is_dir_error1") ); // args > expected no.of args 16: 17: /* Non-existing dir */ 18: var_dump( is_dir("/no/such/dir") ); 19: 20: echo "*** Done ***"; 21: ?> 22: 23: --CLEAN-- 24: <?php 25: rmdir(dirname(__FILE__)."/is_dir_error"); 26: ?> 27: --EXPECTF-- 28: *** Testing is_dir() error conditions *** 29: Warning: is_dir() expects exactly 1 parameter, 0 given in %s on line %d 30: NULL 31: 32: Warning: is_dir() expects exactly 1 parameter, 2 given in %s on line %d 33: NULL 34: bool(false) 35: *** Done ***