Annotation of embedaddon/php/ext/tokenizer/tests/token_get_all_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test token_get_all() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : array token_get_all(string $source)
                      6:  * Description: splits the given source into an array of PHP languange tokens 
                      7:  * Source code: ext/tokenizer/tokenizer.c
                      8: */
                      9: 
                     10: echo "*** Testing token_get_all() : error conditions ***\n";
                     11: 
                     12: // with zero arguments
                     13: echo "\n-- Testing token_get_all() function with zero arguments --\n";
                     14: var_dump( token_get_all());
                     15: 
                     16: // with one more than the expected number of arguments
                     17: echo "-- Testing token_get_all() function with more than expected no. of arguments --\n";
                     18: $source = '<?php ?>';
                     19: $extra_arg = 10;
                     20: var_dump( token_get_all($source, $extra_arg));
                     21: 
                     22: echo "Done"
                     23: ?>
                     24: --EXPECTF--
                     25: *** Testing token_get_all() : error conditions ***
                     26: 
                     27: -- Testing token_get_all() function with zero arguments --
                     28: 
                     29: Warning: token_get_all() expects exactly 1 parameter, 0 given in %s on line %d
                     30: NULL
                     31: -- Testing token_get_all() function with more than expected no. of arguments --
                     32: 
                     33: Warning: token_get_all() expects exactly 1 parameter, 2 given in %s on line %d
                     34: NULL
                     35: Done

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