From 833a39013cea9bab65115f79e0c6612522acad6c Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 31 Oct 2024 20:16:20 +0100 Subject: [PATCH] Adapt ext/intl tests for ICU 76.1 Regarding the test names, see PR #9800. --- ext/intl/tests/bug62070_3.phpt | 1 + ext/intl/tests/bug62070_icu76_1.phpt | 17 ++++ .../tests/collator_get_sort_key_variant7.phpt | 1 + ...collator_get_sort_key_variant_icu76_1.phpt | 97 +++++++++++++++++++ .../tests/timezone_IDforWindowsID_basic2.phpt | 1 + ...timezone_IDforWindowsID_basic_icu76_1.phpt | 44 +++++++++ 6 files changed, 161 insertions(+) create mode 100644 ext/intl/tests/bug62070_icu76_1.phpt create mode 100644 ext/intl/tests/collator_get_sort_key_variant_icu76_1.phpt create mode 100644 ext/intl/tests/timezone_IDforWindowsID_basic_icu76_1.phpt diff --git a/ext/intl/tests/bug62070_3.phpt b/ext/intl/tests/bug62070_3.phpt index 08c1bbf45f8b..60e0593acfd3 100644 --- a/ext/intl/tests/bug62070_3.phpt +++ b/ext/intl/tests/bug62070_3.phpt @@ -4,6 +4,7 @@ Bug #62070: Collator::getSortKey() returns garbage intl --SKIPIF-- = 62.1'); ?> += 0) die('skip for ICU < 76.1'); ?> --FILE-- = 76.1'); ?> +--FILE-- + +--EXPECT-- +93AAG%01%09%01%DC%08 diff --git a/ext/intl/tests/collator_get_sort_key_variant7.phpt b/ext/intl/tests/collator_get_sort_key_variant7.phpt index 44be0bea3fd6..f342a413be5c 100644 --- a/ext/intl/tests/collator_get_sort_key_variant7.phpt +++ b/ext/intl/tests/collator_get_sort_key_variant7.phpt @@ -4,6 +4,7 @@ collator_get_sort_key() icu >= 62.1 intl --SKIPIF-- = 62.1'); ?> += 0) die('skip for ICU < 76.1'); ?> --FILE-- = 62.1 +--EXTENSIONS-- +intl +--SKIPIF-- += 76.1'); ?> +--FILE-- + +--EXPECT-- +source: abc +key: 2b2d2f01070107 +source: abd +key: 2b2d3101070107 +source: aaa +key: 2b2b2b01070107 +source: аа +key: 62060601060106 +source: а +key: 620601050105 +source: z +key: 5d01050105 +source: +key: 0101 +source: 3 +key: 1801050105 +source: y +key: 5b01050105 +source: i +key: 3b01050105 +source: k +key: 3f01050105 +source: абг +key: 28060c1001070107 +source: абв +key: 28060c0e01070107 +source: жжж +key: 282c2c2c01070107 +source: эюя +key: 28eef0f401070107 +source: абг +key: 62060c1001070107 +source: абв +key: 62060c0e01070107 +source: жжж +key: 622c2c2c01070107 +source: эюя +key: 62eef0f401070107 diff --git a/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt b/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt index d80b908c3789..b6728352fc86 100644 --- a/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt +++ b/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt @@ -4,6 +4,7 @@ IntlTimeZone::getIDForWindowsID basic test intl --SKIPIF-- = 58.1'); ?> += 0) die('skip for ICU <= 76.1'); ?> --FILE-- = 76.1'); ?> +--FILE-- + 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: 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(19) "America/Los_Angeles" +** Romance Standard Time +string(12) "Europe/Paris" +string(15) "Europe/Brussels" +string(17) "Europe/Copenhagen" +string(13) "Europe/Madrid" +string(12) "Europe/Paris"