Annotation of embedaddon/php/ext/standard/tests/strings/strip_tags_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strip_tags() function : error conditions
3: --INI--
4: short_open_tag = on
5: --FILE--
6: <?php
7: /* Prototype : string strip_tags(string $str [, string $allowable_tags])
8: * Description: Strips HTML and PHP tags from a string
9: * Source code: ext/standard/string.c
10: */
11:
12:
13: echo "*** Testing strip_tags() : error conditions ***\n";
14:
15: // Zero arguments
16: echo "\n-- Testing strip_tags() function with Zero arguments --\n";
17: var_dump( strip_tags() );
18:
19: //Test strip_tags with one more than the expected number of arguments
20: echo "\n-- Testing strip_tags() function with more than expected no. of arguments --\n";
21: $str = "<html>hello</html>";
22: $allowable_tags = "<html>";
23: $extra_arg = 10;
24: var_dump( strip_tags($str, $allowable_tags, $extra_arg) );
25:
26: echo "Done";
27: ?>
28: --EXPECTF--
29: *** Testing strip_tags() : error conditions ***
30:
31: -- Testing strip_tags() function with Zero arguments --
32:
33: Warning: strip_tags() expects at least 1 parameter, 0 given in %s on line %d
34: NULL
35:
36: -- Testing strip_tags() function with more than expected no. of arguments --
37:
38: Warning: strip_tags() expects at most 2 parameters, 3 given in %s on line %d
39: NULL
40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>