Annotation of embedaddon/php/ext/ctype/tests/ctype_alnum_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test ctype_alnum() function : error conditions - Incorrect number of args
3: --SKIPIF--
4: <?php require_once('skipif.inc'); ?>
5: --FILE--
6: <?php
7: /* Prototype : bool ctype_alnum(mixed $c)
8: * Description: Checks for alphanumeric character(s)
9: * Source code: ext/ctype/ctype.c
10: */
11:
12: /*
13: * Pass incorrect number of arguments to ctype_alnum() to test behaviour
14: */
15:
16: echo "*** Testing ctype_alnum() : error conditions ***\n";
17:
18: $orig = setlocale(LC_CTYPE, "C");
19:
20: // Zero arguments
21: echo "\n-- Testing ctype_alnum() function with Zero arguments --\n";
22: var_dump( ctype_alnum() );
23:
24: //Test ctype_alnum with one more than the expected number of arguments
25: echo "\n-- Testing ctype_alnum() function with more than expected no. of arguments --\n";
26: $c = 1;
27: $extra_arg = 10;
28: var_dump( ctype_alnum($c, $extra_arg) );
29:
30: setlocale(LC_CTYPE, $orig);
31: ?>
32: ===DONE===
33: --EXPECTF--
34: *** Testing ctype_alnum() : error conditions ***
35:
36: -- Testing ctype_alnum() function with Zero arguments --
37:
38: Warning: ctype_alnum() expects exactly 1 parameter, 0 given in %s on line %d
39: NULL
40:
41: -- Testing ctype_alnum() function with more than expected no. of arguments --
42:
43: Warning: ctype_alnum() expects exactly 1 parameter, 2 given in %s on line %d
44: NULL
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>