Annotation of embedaddon/php/ext/date/tests/strftime_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test strftime() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string strftime(string format [, int timestamp])
                      6:  * Description: Format a local time/date according to locale settings 
                      7:  * Source code: ext/date/php_date.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: echo "*** Testing strftime() : error conditions ***\n";
                     12: 
                     13: date_default_timezone_set("Asia/Calcutta");
                     14: //Test strftime with one more than the expected number of arguments
                     15: echo "\n-- Testing strftime() function with more than expected no. of arguments --\n";
                     16: $format = '%b %d %Y %H:%M:%S';
                     17: $timestamp = mktime(8, 8, 8, 8, 8, 2008);
                     18: $extra_arg = 10;
                     19: var_dump( strftime($format, $timestamp, $extra_arg) );
                     20: 
                     21: ?>
                     22: ===DONE===
                     23: --EXPECTF--
                     24: *** Testing strftime() : error conditions ***
                     25: 
                     26: -- Testing strftime() function with more than expected no. of arguments --
                     27: 
                     28: Warning: strftime() expects at most 2 parameters, 3 given in %s on line %d
                     29: bool(false)
                     30: ===DONE===

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