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

1.1       misho       1: --TEST--
                      2: Test date_default_timezone_set() function : error variations
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : bool date_default_timezone_set ( string $timezone_identifier )
                      6:  * Description:  Sets the default timezone used by all date/time functions in a script.
                      7:  * Source code: ext/standard/data/php_date.c
                      8:  */
                      9: 
                     10: echo "*** Testing date_default_timezone_set() : error variations ***\n";
                     11: 
                     12: echo "\n-- Testing date_default_timezone_set() function with less than expected no. of arguments --\n";
                     13: var_dump( date_default_timezone_set() );
                     14: 
                     15: echo "\n-- Testing date_default_timezone_set() function with more than expected no. of arguments --\n";
                     16: $extra_arg = 10;
                     17: var_dump( date_default_timezone_set("GMT", $extra_arg) );
                     18: 
                     19: echo "\n-- Testing date_default_timezone_set() function with invalid timezone identifier  --\n";
                     20: var_dump( date_default_timezone_set("foo") );
                     21: 
                     22: ?>
                     23: ===Done===
                     24: --EXPECTF--
                     25: *** Testing date_default_timezone_set() : error variations ***
                     26: 
                     27: -- Testing date_default_timezone_set() function with less than expected no. of arguments --
                     28: 
                     29: Warning: date_default_timezone_set() expects exactly 1 parameter, 0 given in %s on line %d
                     30: bool(false)
                     31: 
                     32: -- Testing date_default_timezone_set() function with more than expected no. of arguments --
                     33: 
                     34: Warning: date_default_timezone_set() expects exactly 1 parameter, 2 given in %s on line %d
                     35: bool(false)
                     36: 
                     37: -- Testing date_default_timezone_set() function with invalid timezone identifier  --
                     38: 
                     39: Notice: date_default_timezone_set(): Timezone ID 'foo' is invalid in %s on line %d
                     40: bool(false)
                     41: ===Done===

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