Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / date / tests / date_default_timezone_set_error.phpt
blob15c6aa6fedc6da0b5a84d660a6eb8702dfde9335
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  */
10 echo "*** Testing date_default_timezone_set() : error variations ***\n";
12 echo "\n-- Testing date_default_timezone_set() function with less than expected no. of arguments --\n";
13 var_dump( date_default_timezone_set() );
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) );
19 echo "\n-- Testing date_default_timezone_set() function with invalid timezone identifier  --\n";
20 var_dump( date_default_timezone_set("foo") );
23 ===Done===
24 --EXPECTF--
25 *** Testing date_default_timezone_set() : error variations ***
27 -- Testing date_default_timezone_set() function with less than expected no. of arguments --
29 Warning: date_default_timezone_set() expects exactly 1 parameter, 0 given in %s on line %d
30 bool(false)
32 -- Testing date_default_timezone_set() function with more than expected no. of arguments --
34 Warning: date_default_timezone_set() expects exactly 1 parameter, 2 given in %s on line %d
35 bool(false)
37 -- Testing date_default_timezone_set() function with invalid timezone identifier  --
39 Notice: date_default_timezone_set(): Timezone ID 'foo' is invalid in %s on line %d
40 bool(false)
41 ===Done===