Annotation of embedaddon/php/ext/standard/tests/strings/str_replace_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test str_replace() function error conditions
3: --INI--
4: precision=14
5: --FILE--
6: <?php
7: /*
8: Prototype: mixed str_replace(mixed $search, mixed $replace,
9: mixed $subject [, int &$count]);
10: Description: Replace all occurrences of the search string with
11: the replacement string
12: */
13:
14:
15: echo "\n*** Testing str_replace error conditions ***";
16: /* Invalid arguments */
17: var_dump( str_replace() );
18: var_dump( str_replace("") );
19: var_dump( str_replace(NULL) );
20: var_dump( str_replace(1, 2) );
21: var_dump( str_replace(1,2,3,$var,5) );
22:
23: ?>
24: ===DONE===
25: --EXPECTF--
26: *** Testing str_replace error conditions ***
27: Warning: str_replace() expects at least 3 parameters, 0 given in %sstr_replace_error.php on line 12
28: NULL
29:
30: Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 13
31: NULL
32:
33: Warning: str_replace() expects at least 3 parameters, 1 given in %sstr_replace_error.php on line 14
34: NULL
35:
36: Warning: str_replace() expects at least 3 parameters, 2 given in %sstr_replace_error.php on line 15
37: NULL
38:
39: Warning: str_replace() expects at most 4 parameters, 5 given in %sstr_replace_error.php on line 16
40: NULL
41: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>