mirror of
https://github.com/php/php-src.git
synced 2024-12-01 13:54:10 +08:00
Merge branch 'PHP-5.6'
* PHP-5.6: Make date transitions tests more flexible
This commit is contained in:
commit
971441cfe5
@ -16,7 +16,7 @@ date_default_timezone_set("Europe/London");
|
||||
// Create a DateTimeZone object
|
||||
$tz = new DateTimeZone("Europe/London");
|
||||
|
||||
$tran = $tz->getTransitions();
|
||||
$tran = $tz->getTransitions(-306972000, -37241999);
|
||||
|
||||
if (!is_array($tran)) {
|
||||
echo "TEST FAILED: Expected an array\n";
|
||||
@ -25,14 +25,14 @@ if (!is_array($tran)) {
|
||||
echo "\n-- Total number of transitions: " . count($tran). " --\n";
|
||||
|
||||
echo "\n-- Format a sample entry for Spring 1963 --\n";
|
||||
var_dump( $tran[97] );
|
||||
var_dump( $tran[6] );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** Testing DateTimeZone::getTransitions() : basic functionality ***
|
||||
|
||||
-- Total number of transitions: 243 --
|
||||
-- Total number of transitions: 18 --
|
||||
|
||||
-- Format a sample entry for Spring 1963 --
|
||||
array(5) {
|
||||
|
@ -18,24 +18,24 @@ $tz = timezone_open("Europe/London");
|
||||
|
||||
$tran = timezone_transitions_get($tz);
|
||||
|
||||
echo "\n-- Get all transitions --\n";
|
||||
$tran = timezone_transitions_get($tz);
|
||||
echo "\n-- Get all 60s transitions --\n";
|
||||
$tran = timezone_transitions_get($tz, -306972000, -37241999);
|
||||
var_dump( gettype($tran) );
|
||||
|
||||
echo "\n-- Total number of transitions: " . count($tran). " --\n";
|
||||
|
||||
echo "\n-- Format a sample entry pfor Spring 1963 --\n";
|
||||
var_dump( $tran[97] );
|
||||
var_dump( $tran[6] );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** Testing timezone_transitions_get() : basic functionality ***
|
||||
|
||||
-- Get all transitions --
|
||||
-- Get all 60s transitions --
|
||||
string(5) "array"
|
||||
|
||||
-- Total number of transitions: 243 --
|
||||
-- Total number of transitions: 18 --
|
||||
|
||||
-- Format a sample entry pfor Spring 1963 --
|
||||
array(5) {
|
||||
|
Loading…
Reference in New Issue
Block a user