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