Return to chdir_error1.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / dir |
1.1 misho 1: --TEST-- 2: Test chdir() function : error conditions - Incorrect number of arguments 3: --FILE-- 4: <?php 5: /* Prototype : bool chdir(string $directory) 6: * Description: Change the current directory 7: * Source code: ext/standard/dir.c 8: */ 9: 10: /* 11: * Pass incorrect number of arguments to chdir() to test behaviour 12: */ 13: 14: echo "*** Testing chdir() : error conditions ***\n"; 15: 16: // Zero arguments 17: echo "\n-- Testing chdir() function with Zero arguments --\n"; 18: var_dump( chdir() ); 19: 20: //Test chdir with one more than the expected number of arguments 21: echo "\n-- Testing chdir() function with more than expected no. of arguments --\n"; 22: $directory = __FILE__; 23: $extra_arg = 10; 24: var_dump( chdir($directory, $extra_arg) ); 25: ?> 26: ===DONE=== 27: --EXPECTF-- 28: *** Testing chdir() : error conditions *** 29: 30: -- Testing chdir() function with Zero arguments -- 31: 32: Warning: chdir() expects exactly 1 parameter, 0 given in %s on line %d 33: bool(false) 34: 35: -- Testing chdir() function with more than expected no. of arguments -- 36: 37: Warning: chdir() expects exactly 1 parameter, 2 given in %s on line %d 38: bool(false) 39: ===DONE===