Annotation of embedaddon/php/ext/standard/tests/url/base64_decode_error_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test base64_decode() function : error conditions - wrong number of args
3: --FILE--
4: <?php
5: /* Prototype : proto string base64_decode(string str[, bool strict])
6: * Description: Decodes string using MIME base64 algorithm
7: * Source code: ext/standard/base64.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing base64_decode() : error conditions ***\n";
12:
13: // Zero arguments
14: echo "\n-- Testing base64_decode() function with Zero arguments --\n";
15: var_dump( base64_decode() );
16:
17: //Test base64_decode with one more than the expected number of arguments
18: echo "\n-- Testing base64_decode() function with more than expected no. of arguments --\n";
19: $str = 'string_val';
20: $strict = true;
21: $extra_arg = 10;
22: var_dump( base64_decode($str, $strict, $extra_arg) );
23:
24: echo "Done";
25: ?>
26: --EXPECTF--
27: *** Testing base64_decode() : error conditions ***
28:
29: -- Testing base64_decode() function with Zero arguments --
30:
31: Warning: base64_decode() expects at least 1 parameter, 0 given in %s on line 12
32: NULL
33:
34: -- Testing base64_decode() function with more than expected no. of arguments --
35:
36: Warning: base64_decode() expects at most 2 parameters, 3 given in %s on line 19
37: NULL
38: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>