1--TEST--
2Test DateTimeZone::getTransitions() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : array DateTimeZone::getTransitions  ()
6 * Description: Returns all transitions for the timezone
7 * Source code: ext/date/php_date.c
8 * Alias to functions: timezone_transitions_get()
9 */
10
11echo "*** Testing DateTimeZone::getTransitions() : basic functionality ***\n";
12
13//Set the default time zone
14date_default_timezone_set("Europe/London");
15
16// Create a DateTimeZone object
17$tz = new DateTimeZone("Europe/London");
18
19$tran = $tz->getTransitions(-306972000, -37241999);
20
21if (!is_array($tran)) {
22	echo "TEST FAILED: Expected an array\n";
23}
24
25echo "\n-- Total number of transitions: " . count($tran). " --\n";
26
27echo "\n-- Format a sample entry for Spring 1963 --\n";
28var_dump( $tran[6] );
29
30?>
31===DONE===
32--EXPECT--
33*** Testing DateTimeZone::getTransitions() : basic functionality ***
34
35-- Total number of transitions: 18 --
36
37-- Format a sample entry for Spring 1963 --
38array(5) {
39  ["ts"]=>
40  int(-213228000)
41  ["time"]=>
42  string(24) "1963-03-31T02:00:00+0000"
43  ["offset"]=>
44  int(3600)
45  ["isdst"]=>
46  bool(true)
47  ["abbr"]=>
48  string(3) "BST"
49}
50===DONE===