Return to sha1_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test sha1() function : error conditions 3: --FILE-- 4: <?php 5: 6: 7: /* Prototype: string sha1 ( string $str [, bool $raw_output ] ) 8: * Description: Calculate the sha1 hash of a string 9: */ 10: 11: echo "*** Testing sha1() : error conditions ***\n"; 12: 13: echo "\n-- Testing sha1() function with no arguments --\n"; 14: var_dump( sha1() ); 15: 16: echo "\n-- Testing sha1() function with more than expected no. of arguments --\n"; 17: $extra_arg = 10; 18: var_dump( sha1("Hello World", true, $extra_arg) ); 19: 20: 21: ?> 22: ===DONE=== 23: --EXPECTF-- 24: *** Testing sha1() : error conditions *** 25: 26: -- Testing sha1() function with no arguments -- 27: 28: Warning: sha1() expects at least 1 parameter, 0 given in %s on line %d 29: NULL 30: 31: -- Testing sha1() function with more than expected no. of arguments -- 32: 33: Warning: sha1() expects at most 2 parameters, 3 given in %s on line %d 34: NULL 35: ===DONE===