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

1.1       misho       1: --TEST--
                      2: Test DateTime::format() function : error conditions 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : public string DateTime::format  ( string $format  )
                      6:  * Description: Returns date formatted according to given format
                      7:  * Source code: ext/date/php_date.c
                      8:  * Alias to functions: date_format
                      9:  */
                     10:  
                     11: //Set the default time zone 
                     12: date_default_timezone_set("Europe/London");
                     13: 
                     14: // Craete a date object
                     15: $date = new DateTime("2005-07-14 22:30:41");
                     16: 
                     17: echo "*** Testing DateTime::format() : error conditions ***\n";
                     18: 
                     19: echo "\n-- Testing date_date_formatcreate() function with zero arguments --\n";
                     20: var_dump( $date->format() );
                     21: 
                     22: echo "\n-- Testing date_date_formatcreate() function with more than expected no. of arguments --\n";
                     23: $format = "F j, Y, g:i a";
                     24: $extra_arg = 10;
                     25: var_dump( $date->format($format, $extra_arg) );   
                     26: 
                     27: ?>
                     28: ===DONE===
                     29: --EXPECTF--
                     30: *** Testing DateTime::format() : error conditions ***
                     31: 
                     32: -- Testing date_date_formatcreate() function with zero arguments --
                     33: 
                     34: Warning: DateTime::format() expects exactly 1 parameter, 0 given in %s on line %d
                     35: bool(false)
                     36: 
                     37: -- Testing date_date_formatcreate() function with more than expected no. of arguments --
                     38: 
                     39: Warning: DateTime::format() expects exactly 1 parameter, 2 given in %s on line %d
                     40: bool(false)
                     41: ===DONE===

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