-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync some tests for compat with ICU 58.1, PHP 7.1+ part
- Loading branch information
Showing
4 changed files
with
95 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--TEST-- | ||
IntlTimeZone::getIDForWindowsID basic test | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('intl')) | ||
die('skip intl extension not enabled'); ?> | ||
<?php if (version_compare(INTL_ICU_VERSION, '52') < 0) die('skip for ICU >= 52'); ?> | ||
<?php if (version_compare(INTL_ICU_VERSION, '57.1') < 0) die('skip for ICU >= 58.1'); ?> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
weltling
Author
Contributor
|
||
--FILE-- | ||
<?php | ||
|
||
$tzs = array( | ||
'Gnomeregan' => array(NULL), | ||
'India Standard Time' => array(NULL), | ||
'Pacific Standard Time' => array('001', 'CA', 'MX', 'US', 'ZZ'), | ||
'Romance Standard Time' => array('001', 'BE', 'DK', 'ES', 'FR'), | ||
); | ||
|
||
foreach ($tzs as $tz => $regions) { | ||
echo "** $tz\n"; | ||
foreach ($regions as $region) { | ||
var_dump(IntlTimeZone::getIDForWindowsID($tz, $region)); | ||
if (intl_get_error_code() != U_ZERO_ERROR) { | ||
echo "Error: ", intl_get_error_message(), "\n"; | ||
} | ||
} | ||
} | ||
|
||
--EXPECT-- | ||
** Gnomeregan | ||
bool(false) | ||
Error: intltz_get_windows_id: Unknown windows timezone: U_ILLEGAL_ARGUMENT_ERROR | ||
** India Standard Time | ||
string(13) "Asia/Calcutta" | ||
** Pacific Standard Time | ||
string(19) "America/Los_Angeles" | ||
string(17) "America/Vancouver" | ||
string(19) "America/Los_Angeles" | ||
string(19) "America/Los_Angeles" | ||
string(7) "PST8PDT" | ||
** Romance Standard Time | ||
string(12) "Europe/Paris" | ||
string(15) "Europe/Brussels" | ||
string(17) "Europe/Copenhagen" | ||
string(13) "Europe/Madrid" | ||
string(12) "Europe/Paris" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--TEST-- | ||
IntlTimeZone::getWindowsID basic test | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('intl')) | ||
die('skip intl extension not enabled'); ?> | ||
<?php if (version_compare(INTL_ICU_VERSION, '52') < 0) die('skip for ICU >= 52'); ?> | ||
<?php if (version_compare(INTL_ICU_VERSION, '57.1') < 0) die('skip for ICU >= 58.1'); ?> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
--FILE-- | ||
<?php | ||
|
||
$tzs = array( | ||
'America/Bogota', | ||
'America/Havana', | ||
'America/Indiana/Knox', | ||
'America/Los_Angeles', | ||
'Azeroth/Kalimdor/Durotar', | ||
'Africa/Casablanca', | ||
'Asia/Singapore', | ||
'Australia/Perth', | ||
'Europe/London', | ||
'Europe/Istanbul', | ||
); | ||
|
||
foreach ($tzs as $tz) { | ||
var_dump(IntlTimeZone::getWindowsID($tz)); | ||
if (intl_get_error_code() != U_ZERO_ERROR) { | ||
echo "Error: ", intl_get_error_message(), "\n"; | ||
} | ||
} | ||
|
||
--EXPECT-- | ||
string(24) "SA Pacific Standard Time" | ||
string(18) "Cuba Standard Time" | ||
string(21) "Central Standard Time" | ||
string(21) "Pacific Standard Time" | ||
bool(false) | ||
Error: intltz_get_windows_id: Unknown system timezone: U_ILLEGAL_ARGUMENT_ERROR | ||
string(21) "Morocco Standard Time" | ||
string(23) "Singapore Standard Time" | ||
string(26) "W. Australia Standard Time" | ||
string(17) "GMT Standard Time" | ||
string(20) "Turkey Standard Time" |
skips for >=52 and >= 58.1 ?