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

1.1       misho       1: --TEST--
                      2: Test date() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string date  ( string $format  [, int $timestamp  ] )
                      6:  * Description: Format a local time/date.
                      7:  * Source code: ext/date/php_date.c
                      8:  */
                      9: 
                     10: echo "*** Testing date() : error conditions ***\n";
                     11: 
                     12: //Set the default time zone 
                     13: date_default_timezone_set("America/Chicago");
                     14: 
                     15: $format = "m.d.y";
                     16: $timestamp = mktime(10, 44, 30, 2, 27, 2009);
                     17: 
                     18: echo "\n-- Testing date function with no arguments --\n";
                     19: var_dump (date());
                     20: 
                     21: echo "\n-- Testing date function with more than expected no. of arguments --\n";
                     22: $extra_arg = true;
                     23: var_dump (checkdate($format, $timestamp, $extra_arg));
                     24: 
                     25: ?>
                     26: ===DONE=== 
                     27: --EXPECTF--
                     28: *** Testing date() : error conditions ***
                     29: 
                     30: -- Testing date function with no arguments --
                     31: 
                     32: Warning: date() expects at least 1 parameter, 0 given in %s on line %d
                     33: bool(false)
                     34: 
                     35: -- Testing date function with more than expected no. of arguments --
                     36: 
                     37: Warning: checkdate() expects parameter 1 to be long, string given in %s on line %d
                     38: bool(false)
                     39: ===DONE===

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