com php-src: Sync some tests for compat with ICU 58.1, PHP 7.1+ part: ext/intl/tests/timezone_IDforWindowsID_basic.phpt ext/i
ntl/tests/timezone_IDforWindowsID_basic2.phpt ext/int l/tests/timezone_windowsID_basic.phpt ext/intl/tests/ti mezone_windowsID_basic2.phpt
| From: | Anatol Belski | Date: | Fri, 20 Oct 2017 11:56:58 +0000 |
| Subject: | com php-src: Sync some tests for compat with ICU 58.1, PHP 7.1+ part: ext/intl/tests/timezone_IDforWindowsID_basic.phpt ext/i ntl/tests/timezone_IDforWindowsID_basic2.phpt ext/int l/tests/timezone_windowsID_basic.phpt ext/intl/tests/ti mezone_windowsID_basic2.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99815@lists.php.net to get a copy of this message | ||
Commit: 26473523b02d076e3108084a745ecd2ea4b8f61f
Author: Anatol Belski <ab@php.net> Fri, 20 Oct 2017 13:56:58 +0200
Parents: 7751ae59aef14562bb73dc64c366d766c644d720
Branches: PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=26473523b02d076e3108084a745ecd2ea4b8f61f
Log:
Sync some tests for compat with ICU 58.1, PHP 7.1+ part
Changed paths:
M ext/intl/tests/timezone_IDforWindowsID_basic.phpt
A ext/intl/tests/timezone_IDforWindowsID_basic2.phpt
M ext/intl/tests/timezone_windowsID_basic.phpt
A ext/intl/tests/timezone_windowsID_basic2.phpt
Diff:
diff --git a/ext/intl/tests/timezone_IDforWindowsID_basic.phpt
b/ext/intl/tests/timezone_IDforWindowsID_basic.phpt
index 4127d8e..935a893 100644
--- a/ext/intl/tests/timezone_IDforWindowsID_basic.phpt
+++ b/ext/intl/tests/timezone_IDforWindowsID_basic.phpt
@@ -3,9 +3,9 @@ IntlTimeZone::getIDForWindowsID basic test
--SKIPIF--
<?php
if (!extension_loaded('intl'))
- die('skip intl extension not enabled');
-if (version_compare(INTL_ICU_VERSION, '52') < 0)
- die('skip for ICU >= 52');
+ 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
<= 57.1'); ?>
--FILE--
<?php
diff --git a/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt
b/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt
new file mode 100644
index 0000000..2929fb9
--- /dev/null
+++ b/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt
@@ -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'); ?>
+--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"
diff --git a/ext/intl/tests/timezone_windowsID_basic.phpt
b/ext/intl/tests/timezone_windowsID_basic.phpt
index dd48f01..0a9fd3b 100644
--- a/ext/intl/tests/timezone_windowsID_basic.phpt
+++ b/ext/intl/tests/timezone_windowsID_basic.phpt
@@ -3,9 +3,9 @@ IntlTimeZone::getWindowsID basic test
--SKIPIF--
<?php
if (!extension_loaded('intl'))
- die('skip intl extension not enabled');
-if (version_compare(INTL_ICU_VERSION, '52') < 0)
- die('skip for ICU >= 52');
+ 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
<= 57.1'); ?>
--FILE--
<?php
diff --git a/ext/intl/tests/timezone_windowsID_basic2.phpt
b/ext/intl/tests/timezone_windowsID_basic2.phpt
new file mode 100644
index 0000000..f2540f5
--- /dev/null
+++ b/ext/intl/tests/timezone_windowsID_basic2.phpt
@@ -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'); ?>
+--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"