1--TEST--
2Test token_get_all() function : error conditions
3--FILE--
4<?php
5/* Prototype  : array token_get_all(string $source)
6 * Description: splits the given source into an array of PHP languange tokens
7 * Source code: ext/tokenizer/tokenizer.c
8*/
9
10echo "*** Testing token_get_all() : error conditions ***\n";
11
12// with zero arguments
13echo "\n-- Testing token_get_all() function with zero arguments --\n";
14var_dump( token_get_all());
15
16// with one more than the expected number of arguments
17echo "-- Testing token_get_all() function with more than expected no. of arguments --\n";
18$source = '<?php ?>';
19$extra_arg = 10;
20var_dump( token_get_all($source, $extra_arg));
21
22echo "Done"
23?>
24--EXPECTF--
25*** Testing token_get_all() : error conditions ***
26
27-- Testing token_get_all() function with zero arguments --
28
29Warning: token_get_all() expects exactly 1 parameter, 0 given in %s on line %d
30NULL
31-- Testing token_get_all() function with more than expected no. of arguments --
32
33Warning: token_get_all() expects exactly 1 parameter, 2 given in %s on line %d
34NULL
35Done
36