Annotation of embedaddon/php/ext/standard/tests/strings/similar_text_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: similar_text(), error tests for missing parameters
3: --CREDITS--
4: Mats Lindh <mats at lindh.no>
5: #Testfest php.no
6: --FILE--
7: <?php
8: /* Prototype : proto int similar_text(string str1, string str2 [, float percent])
9: * Description: Calculates the similarity between two strings
10: * Source code: ext/standard/string.c
11: */
12:
13: $extra_arg = 10;
14: echo "\n-- Testing similar_text() function with more than expected no. of arguments --\n";
15: similar_text("abc", "def", $percent, $extra_arg);
16:
17: echo "\n-- Testing similar_text() function with less than expected no. of arguments --\n";
18: similar_text("abc");
19: ?>
20: ===DONE===
21: --EXPECTF--
22: -- Testing similar_text() function with more than expected no. of arguments --
23:
24: Warning: similar_text() expects at most 3 parameters, 4 given in %s on line %d
25:
26: -- Testing similar_text() function with less than expected no. of arguments --
27:
28: Warning: similar_text() expects at least 2 parameters, 1 given in %s on line %d
29: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>