Skip to content

Commit

Permalink
Fixed ext/date tests due to changes in Olson database
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Nov 7, 2017
1 parent c842e1a commit ba9df1c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 126 deletions.
7 changes: 0 additions & 7 deletions ext/date/tests/DateTimeZone_getLocation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ Array
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] =>
)
Array
(
[country_code] => %s
[latitude] => %f
Expand Down
69 changes: 12 additions & 57 deletions ext/date/tests/DateTimeZone_listAbbreviations_basic1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,8 @@ string(5) "array"
int(%d)

-- Format a sample entry --
array(17) {
array(12) {
[0]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(18) "America/Porto_Acre"
}
[1]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -48,7 +39,7 @@ array(17) {
["timezone_id"]=>
string(18) "Australia/Adelaide"
}
[2]=>
[1]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -57,34 +48,7 @@ array(17) {
["timezone_id"]=>
string(18) "Australia/Adelaide"
}
[3]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(16) "America/Eirunepe"
}
[4]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(18) "America/Rio_Branco"
}
[5]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(11) "Brazil/Acre"
}
[6]=>
[2]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -93,7 +57,7 @@ array(17) {
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
}
[7]=>
[3]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -102,7 +66,7 @@ array(17) {
["timezone_id"]=>
string(16) "Australia/Darwin"
}
[8]=>
[4]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -111,7 +75,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/North"
}
[9]=>
[5]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -120,7 +84,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/South"
}
[10]=>
[6]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -129,16 +93,7 @@ array(17) {
["timezone_id"]=>
string(20) "Australia/Yancowinna"
}
[11]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
["timezone_id"]=>
string(13) "Asia/Jayapura"
}
[12]=>
[7]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -147,7 +102,7 @@ array(17) {
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
}
[13]=>
[8]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -156,7 +111,7 @@ array(17) {
["timezone_id"]=>
string(16) "Australia/Darwin"
}
[14]=>
[9]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -165,7 +120,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/North"
}
[15]=>
[10]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -174,7 +129,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/South"
}
[16]=>
[11]=>
array(3) {
["dst"]=>
bool(false)
Expand Down
2 changes: 1 addition & 1 deletion ext/date/tests/bug45081.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ date.timezone=Asia/Singapore
--FILE--
<?php

print strtotime('2008-05-23 00:00:00 SGT');
print strtotime('2008-05-23 00:00:00 +08');
print "\n";
print strtotime('2008-05-23 00:00:00');

Expand Down
71 changes: 13 additions & 58 deletions ext/date/tests/timezone_abbreviations_list_basic1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,11 @@ var_dump( $abbr["acst"] );
--EXPECTF--
*** Testing timezone_abbreviations_list() : basic functionality ***
string(5) "array"
int(%d)
int(142)

-- Format a sample entry --
array(17) {
array(12) {
[0]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(18) "America/Porto_Acre"
}
[1]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -48,7 +39,7 @@ array(17) {
["timezone_id"]=>
string(18) "Australia/Adelaide"
}
[2]=>
[1]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -57,34 +48,7 @@ array(17) {
["timezone_id"]=>
string(18) "Australia/Adelaide"
}
[3]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(16) "America/Eirunepe"
}
[4]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(18) "America/Rio_Branco"
}
[5]=>
array(3) {
["dst"]=>
bool(true)
["offset"]=>
int(-14400)
["timezone_id"]=>
string(11) "Brazil/Acre"
}
[6]=>
[2]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -93,7 +57,7 @@ array(17) {
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
}
[7]=>
[3]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -102,7 +66,7 @@ array(17) {
["timezone_id"]=>
string(16) "Australia/Darwin"
}
[8]=>
[4]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -111,7 +75,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/North"
}
[9]=>
[5]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -120,7 +84,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/South"
}
[10]=>
[6]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -129,16 +93,7 @@ array(17) {
["timezone_id"]=>
string(20) "Australia/Yancowinna"
}
[11]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
["timezone_id"]=>
string(13) "Asia/Jayapura"
}
[12]=>
[7]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -147,7 +102,7 @@ array(17) {
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
}
[13]=>
[8]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -156,7 +111,7 @@ array(17) {
["timezone_id"]=>
string(16) "Australia/Darwin"
}
[14]=>
[9]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -165,7 +120,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/North"
}
[15]=>
[10]=>
array(3) {
["dst"]=>
bool(false)
Expand All @@ -174,7 +129,7 @@ array(17) {
["timezone_id"]=>
string(15) "Australia/South"
}
[16]=>
[11]=>
array(3) {
["dst"]=>
bool(false)
Expand Down
4 changes: 1 addition & 3 deletions ext/date/tests/timezone_name_from_abbr_basic1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var_dump( timezone_name_from_abbr("EDT") );
echo "-- Lookup with name and offset--\n";
var_dump( timezone_name_from_abbr("ADT", -10800) );
var_dump( timezone_name_from_abbr("ADT", 14400) );
var_dump( timezone_name_from_abbr("AMST", -10800) );

echo "-- Tests without valid name - uses gmtOffset and isdst to find match --\n";
var_dump( timezone_name_from_abbr("", 3600, 1) );
Expand All @@ -47,8 +46,7 @@ string(13) "Europe/Berlin"
string(16) "America/New_York"
-- Lookup with name and offset--
string(15) "America/Halifax"
string(12) "Asia/Baghdad"
string(17) "America/Boa_Vista"
string(15) "America/Halifax"
-- Tests without valid name - uses gmtOffset and isdst to find match --
string(13) "Europe/London"
string(17) "America/Sao_Paulo"
Expand Down

0 comments on commit ba9df1c

Please sign in to comment.