]> granicus.if.org Git - php/blob
b3bf7c84a1
[php] /
1 --TEST--
2 Test timezone_abbreviations_list() function : basic functionality
3 --FILE--
4 <?php
5 /* Prototype  : array timezone_abbreviations_list  ( void  )
6  * Description: Returns associative array containing dst, offset and the timezone name
7  * Source code: ext/date/php_date.c
8  * Alias to functions: DateTimeZone::listAbbreviations
9  */
10
11 echo "*** Testing timezone_abbreviations_list() : basic functionality ***\n";
12
13 //Set the default time zone
14 date_default_timezone_set("GMT");
15
16 $abbr = timezone_abbreviations_list();
17
18 var_dump( gettype($abbr) );
19 var_dump( count($abbr) );
20
21 echo "\n-- Format a sample entry --\n";
22 var_dump( $abbr["acst"] );
23
24 ?>
25 --EXPECTF--
26 *** Testing timezone_abbreviations_list() : basic functionality ***
27 string(5) "array"
28 int(144)
29
30 -- Format a sample entry --
31 array(6) {
32   [0]=>
33   array(3) {
34     ["dst"]=>
35     bool(false)
36     ["offset"]=>
37     int(34200)
38     ["timezone_id"]=>
39     string(18) "Australia/Adelaide"
40   }
41   [1]=>
42   array(3) {
43     ["dst"]=>
44     bool(false)
45     ["offset"]=>
46     int(34200)
47     ["timezone_id"]=>
48     string(21) "Australia/Broken_Hill"
49   }
50   [2]=>
51   array(3) {
52     ["dst"]=>
53     bool(false)
54     ["offset"]=>
55     int(34200)
56     ["timezone_id"]=>
57     string(16) "Australia/Darwin"
58   }
59   [3]=>
60   array(3) {
61     ["dst"]=>
62     bool(false)
63     ["offset"]=>
64     int(34200)
65     ["timezone_id"]=>
66     string(15) "Australia/North"
67   }
68   [4]=>
69   array(3) {
70     ["dst"]=>
71     bool(false)
72     ["offset"]=>
73     int(34200)
74     ["timezone_id"]=>
75     string(15) "Australia/South"
76   }
77   [5]=>
78   array(3) {
79     ["dst"]=>
80     bool(false)
81     ["offset"]=>
82     int(34200)
83     ["timezone_id"]=>
84     string(20) "Australia/Yancowinna"
85   }
86 }