Annotation of embedaddon/php/ext/standard/tests/strings/stripslashes_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test stripslashes() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : string stripslashes ( string $str )
6: * Description: Returns an un-quoted string
7: * Source code: ext/standard/string.c
8: */
9:
10: /*
11: * Testing stripslashes() for error conditions
12: */
13:
14: echo "*** Testing stripslashes() : error conditions ***\n";
15:
16: // Zero argument
17: echo "\n-- Testing stripslashes() function with Zero arguments --\n";
18: var_dump( stripslashes() );
19:
20: // More than expected number of arguments
21: echo "\n-- Testing stripslashes() function with more than expected no. of arguments --\n";
22: $str = '\"hello\"\"world\"';
23: $extra_arg = 10;
24:
25: var_dump( stripslashes($str, $extra_arg) );
26: var_dump( $str );
27:
28: echo "Done\n";
29: ?>
30: --EXPECTF--
31: *** Testing stripslashes() : error conditions ***
32:
33: -- Testing stripslashes() function with Zero arguments --
34:
35: Warning: stripslashes() expects exactly 1 parameter, 0 given in %s on line %d
36: NULL
37:
38: -- Testing stripslashes() function with more than expected no. of arguments --
39:
40: Warning: stripslashes() expects exactly 1 parameter, 2 given in %s on line %d
41: NULL
42: string(18) "\"hello\"\"world\""
43: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>