1--TEST--
2Test mb_decode_mimeheader() function : error conditions
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip');
6function_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
16echo "*** Testing mb_decode_mimeheader() : error conditions ***\n";
17
18// Zero arguments
19echo "\n-- Testing mb_decode_mimeheader() function with Zero arguments --\n";
20var_dump( mb_decode_mimeheader() );
21
22//Test mb_decode_mimeheader with one more than the expected number of arguments
23echo "\n-- Testing mb_decode_mimeheader() function with more than expected no. of arguments --\n";
24$string = 'string_val';
25$extra_arg = 10;
26var_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
35Warning: mb_decode_mimeheader() expects exactly 1 parameter, 0 given in %s on line %d
36NULL
37
38-- Testing mb_decode_mimeheader() function with more than expected no. of arguments --
39
40Warning: mb_decode_mimeheader() expects exactly 1 parameter, 2 given in %s on line %d
41NULL
42===DONE===
43