Return to base64_encode_error_001.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / url |
1.1 misho 1: --TEST-- 2: Test base64_encode() function : error conditions - wrong number of args 3: --FILE-- 4: <?php 5: /* Prototype : proto string base64_encode(string str) 6: * Description: Encodes string using MIME base64 algorithm 7: * Source code: ext/standard/base64.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing base64_encode() : error conditions - wrong number of args ***\n"; 12: 13: // Zero arguments 14: echo "\n-- Testing base64_encode() function with Zero arguments --\n"; 15: var_dump( base64_encode() ); 16: 17: //Test base64_encode with one more than the expected number of arguments 18: echo "\n-- Testing base64_encode() function with more than expected no. of arguments --\n"; 19: $str = 'string_val'; 20: $extra_arg = 10; 21: var_dump( base64_encode($str, $extra_arg) ); 22: 23: echo "Done"; 24: ?> 25: --EXPECTF-- 26: *** Testing base64_encode() : error conditions - wrong number of args *** 27: 28: -- Testing base64_encode() function with Zero arguments -- 29: 30: Warning: base64_encode() expects exactly 1 parameter, 0 given in %s on line 12 31: NULL 32: 33: -- Testing base64_encode() function with more than expected no. of arguments -- 34: 35: Warning: base64_encode() expects exactly 1 parameter, 2 given in %s on line 18 36: NULL 37: Done