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