[php-src] master: ext/intl: Adapt timezone test expectations for ICU 79.1

From: Date: Sun, 25 Oct 2026 14:13:04 +0000
Subject: [php-src] master: ext/intl: Adapt timezone test expectations for ICU 79.1
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142718@lists.php.net to get a copy of this message
Author: Alessio Attilio (kairosci) Committer: David Carlier (devnexen) Date: 2026-10-25T14:11:52Z Commit: https://github.com/php/php-src/commit/47d959923c4a6cc6d8551710843a2e9b7381531f Raw diff: https://github.com/php/php-src/commit/47d959923c4a6cc6d8551710843a2e9b7381531f.diff ext/intl: Adapt timezone test expectations for ICU 79.1 Keep the existing expectations for older ICU releases and add ICU 79.1 variants for Portuguese GMT offset formatting and the Canadian Pacific Standard Time mapping. Close GH-24684 Changed paths: A ext/intl/tests/dateformat_formatObject_calendar_variant_icu79-1.phpt A ext/intl/tests/dateformat_formatObject_datetime_variant_icu79-1.phpt A ext/intl/tests/timezone_IDforWindowsID_basic_icu79_1.phpt M ext/intl/tests/dateformat_formatObject_calendar_variant_icu72-1.phpt M ext/intl/tests/dateformat_formatObject_datetime_variant_icu72-1.phpt M ext/intl/tests/timezone_IDforWindowsID_basic_icu76_1.phpt Diff: diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant_icu72-1.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant_icu72-1.phpt index 6a2f7c6abd95..618629cc1861 100644 --- a/ext/intl/tests/dateformat_formatObject_calendar_variant_icu72-1.phpt +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant_icu72-1.phpt @@ -7,6 +7,7 @@ intl.default_locale=pt_PT date.timezone=Europe/Lisbon --SKIPIF-- <?php if (version_compare(INTL_ICU_VERSION, '72.1') < 0) die('skip for ICU >= 72.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '79.1') >= 0) die('skip for ICU < 79.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant_icu79-1.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant_icu79-1.phpt new file mode 100644 index 000000000000..c467d6443431 --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant_icu79-1.phpt @@ -0,0 +1,37 @@ +--TEST-- +IntlDateFormatter::formatObject(): IntlCalendar tests +--EXTENSIONS-- +intl +--INI-- +intl.default_locale=pt_PT +date.timezone=Europe/Lisbon +--SKIPIF-- +<?php if (version_compare(INTL_ICU_VERSION, '79.1') < 0) die('skip for ICU >= 79.1'); ?> +--FILE-- +<?php + +$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00'); +echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n"; + +$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil'); +$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.); +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; + +?> +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard Time +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 +03:00 GMT +06/02/1433, 00:00:00 +Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant_icu72-1.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant_icu72-1.phpt index d1aecab9819c..37f7c9a8f917 100644 --- a/ext/intl/tests/dateformat_formatObject_datetime_variant_icu72-1.phpt +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant_icu72-1.phpt @@ -7,6 +7,7 @@ intl.default_locale=pt_PT date.timezone=Europe/Lisbon --SKIPIF-- <?php if (version_compare(INTL_ICU_VERSION, '72.1') < 0) die('skip for ICU >= 72.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '79.1') >= 0) die('skip for ICU < 79.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant_icu79-1.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant_icu79-1.phpt new file mode 100644 index 000000000000..60947db41cbc --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant_icu79-1.phpt @@ -0,0 +1,30 @@ +--TEST-- +IntlDateFormatter::formatObject(): DateTime tests +--EXTENSIONS-- +intl +--INI-- +intl.default_locale=pt_PT +date.timezone=Europe/Lisbon +--SKIPIF-- +<?php if (version_compare(INTL_ICU_VERSION, '79.1') < 0) die('skip for ICU >= 79.1'); ?> +--FILE-- +<?php + +$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($dt), "\n"; +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$dt = new DateTime('2012-01-01 05:00:00+03:00'); +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; + +?> +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard Time +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 +03:00 GMT diff --git a/ext/intl/tests/timezone_IDforWindowsID_basic_icu76_1.phpt b/ext/intl/tests/timezone_IDforWindowsID_basic_icu76_1.phpt index d07c14797c65..8c2d38c17e4f 100644 --- a/ext/intl/tests/timezone_IDforWindowsID_basic_icu76_1.phpt +++ b/ext/intl/tests/timezone_IDforWindowsID_basic_icu76_1.phpt @@ -4,6 +4,7 @@ IntlTimeZone::getIDForWindowsID basic test intl --SKIPIF-- <?php if (version_compare(INTL_ICU_VERSION, '76.1') < 0) die('skip for ICU >= 76.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '79.1') >= 0) die('skip for ICU < 79.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/timezone_IDforWindowsID_basic_icu79_1.phpt b/ext/intl/tests/timezone_IDforWindowsID_basic_icu79_1.phpt new file mode 100644 index 000000000000..a2fa96075cd7 --- /dev/null +++ b/ext/intl/tests/timezone_IDforWindowsID_basic_icu79_1.phpt @@ -0,0 +1,40 @@ +--TEST-- +IntlTimeZone::getIDForWindowsID basic test +--EXTENSIONS-- +intl +--SKIPIF-- +<?php if (version_compare(INTL_ICU_VERSION, '79.1') < 0) die('skip for ICU >= 79.1'); ?> +--FILE-- +<?php + +$tzs = array( + '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-- +** India Standard Time +string(13) "Asia/Calcutta" +** Pacific Standard Time +string(19) "America/Los_Angeles" +string(19) "America/Los_Angeles" +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"

« previous php.cvs (#142718) next »