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