Annotation of embedaddon/php/ext/mbstring/tests/mb_decode_mimeheader_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test mb_decode_mimeheader() function : error conditions
3: --SKIPIF--
4: <?php
5: extension_loaded('mbstring') or die('skip');
6: function_exists('mb_decode_mimeheader') or die("skip mb_decode_mimeheader() is not available in this build");
7: ?>
8: --FILE--
9: <?php
10: /* Prototype : string mb_decode_mimeheader(string string)
11: * Description: Decodes the MIME "encoded-word" in the string
12: * Source code: ext/mbstring/mbstring.c
13: * Alias to functions:
14: */
15:
16: echo "*** Testing mb_decode_mimeheader() : error conditions ***\n";
17:
18: // Zero arguments
19: echo "\n-- Testing mb_decode_mimeheader() function with Zero arguments --\n";
20: var_dump( mb_decode_mimeheader() );
21:
22: //Test mb_decode_mimeheader with one more than the expected number of arguments
23: echo "\n-- Testing mb_decode_mimeheader() function with more than expected no. of arguments --\n";
24: $string = 'string_val';
25: $extra_arg = 10;
26: var_dump( mb_decode_mimeheader($string, $extra_arg) );
27:
28: ?>
29: ===DONE===
30: --EXPECTF--
31: *** Testing mb_decode_mimeheader() : error conditions ***
32:
33: -- Testing mb_decode_mimeheader() function with Zero arguments --
34:
35: Warning: mb_decode_mimeheader() expects exactly 1 parameter, 0 given in %s on line %d
36: NULL
37:
38: -- Testing mb_decode_mimeheader() function with more than expected no. of arguments --
39:
40: Warning: mb_decode_mimeheader() expects exactly 1 parameter, 2 given in %s on line %d
41: NULL
42: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>