Annotation of embedaddon/php/ext/pcre/tests/preg_quote_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test preg_quote() function : error conditions  - wrong numbers of parameters 
                      3: --FILE--
                      4: <?php
                      5: /*
                      6: * proto string preg_quote(string str [, string delim_char])
                      7: * Function is implemented in ext/pcre/php_pcre.c
                      8: */
                      9: echo "*** Testing preg_quote() : error conditions ***\n";
                     10: // Zero arguments
                     11: echo "\n-- Testing preg_quote() function with Zero arguments --\n";
                     12: var_dump(preg_quote());
                     13: //Test preg_quote with one more than the expected number of arguments
                     14: echo "\n-- Testing preg_quote() function with more than expected no. of arguments --\n";
                     15: $str = 'string_val';
                     16: $delim_char = '/';
                     17: $extra_arg = 10;
                     18: var_dump(preg_quote($str, $delim_char, $extra_arg));
                     19: echo "Done"
                     20: ?>
                     21: --EXPECTF--
                     22: *** Testing preg_quote() : error conditions ***
                     23: 
                     24: -- Testing preg_quote() function with Zero arguments --
                     25: 
                     26: Warning: preg_quote() expects at least 1 parameter, 0 given in %spreg_quote_error.php on line %d
                     27: NULL
                     28: 
                     29: -- Testing preg_quote() function with more than expected no. of arguments --
                     30: 
                     31: Warning: preg_quote() expects at most 2 parameters, 3 given in %spreg_quote_error.php on line %d
                     32: NULL
                     33: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>