Skip to content

Commit 333cf3c

Browse files
committed
Fix phpGH-12635: Test bug69398.phpt fails with ICU 74.1
ICU 74.1 contains new locale data that breaks the test. Split the test based on the version number to resolve the issue. Closes phpGH-12653.
1 parent d316712 commit 333cf3c

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.2.14
44

5+
- Intl:
6+
. Fixed bug GH-12635 (Test bug69398.phpt fails with ICU 74.1). (nielsdos)
7+
58
- PCRE:
69
. Fixed bug GH-12628 (The gh11374 test fails on Alpinelinux). (nielsdos)
710

ext/intl/tests/bug69398-icu74.1.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
IntlDateFormatter::formatObject(): returns wrong value when time style is NONE.
3+
--EXTENSIONS--
4+
intl
5+
--SKIPIF--
6+
<?php
7+
if (version_compare(INTL_ICU_VERSION, '74.1') < 0) die('skip for ICU < 74.1');
8+
?>
9+
--FILE--
10+
<?php
11+
$millitimestamp = 1428133423941.0; // 14:43:43 April 04 2015
12+
$date = IntlCalendar::createInstance('Asia/Ho_Chi_Minh');
13+
$date->setTime($millitimestamp);
14+
echo IntlDateFormatter::formatObject($date, array(IntlDateFormatter::SHORT, IntlDateFormatter::NONE), 'vi_VN'), "\n";
15+
echo IntlDateFormatter::formatObject ($date, array(IntlDateFormatter::SHORT, IntlDateFormatter::NONE), 'ko_KR'), "\n";
16+
?>
17+
--EXPECT--
18+
4/4/15
19+
15. 4. 4.

ext/intl/tests/bug69398.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ IntlDateFormatter::formatObject(): returns wrong value when time style is NONE.
33
--EXTENSIONS--
44
intl
55
--SKIPIF--
6-
<?php if (version_compare(INTL_ICU_VERSION, '50.1.2') < 0) die('skip for ICU >= 51.1.2'); ?>
6+
<?php
7+
if (version_compare(INTL_ICU_VERSION, '50.1.2') < 0) die('skip for ICU < 51.1.2');
8+
if (version_compare(INTL_ICU_VERSION, '74.1') >= 0) die('skip for ICU >= 74.1');
9+
?>
710
--FILE--
811
<?php
912
$millitimestamp = 1428133423941.0; // 14:43:43 April 04 2015

0 commit comments

Comments
 (0)