Skip to content

Commit c7a2441

Browse files
ramseynikic
authored andcommitted
CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
Refer to: unicode-org/icu@49dda34
1 parent 52cda6f commit c7a2441

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

ext/intl/tests/dateformat_get_set_calendar_variant5.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
--TEST--
2-
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
2+
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() for ICU >= 58.1 and < 70.1
33
--SKIPIF--
44
<?php
5-
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6-
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
5+
if (!extension_loaded('intl')) die('skip intl extension not enabled');
6+
if (version_compare(INTL_ICU_VERSION, '58.1') < 0 || version_compare(INTL_ICU_VERSION, '70.1') >= 0) die('skip for ICU >= 58.1 and < 70.1');
7+
?>
78
--FILE--
89
<?php
910
ini_set("intl.error_level", E_WARNING);
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
--TEST--
2+
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() for ICU >= 70.1
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('intl')) die('skip');
6+
if (version_compare(INTL_ICU_VERSION, '70.1') < 0) die('skip for ICU >= 70.1');
7+
?>
8+
--FILE--
9+
<?php
10+
ini_set("intl.error_level", E_WARNING);
11+
ini_set("intl.default_locale", "pt_PT");
12+
ini_set("date.timezone", 'Atlantic/Azores');
13+
14+
$ts = strtotime('2012-01-01 00:00:00 UTC');
15+
16+
function d(IntlDateFormatter $df) {
17+
global $ts;
18+
echo $df->format($ts), "\n";
19+
var_dump($df->getCalendar(),
20+
$df->getCalendarObject()->getType(),
21+
$df->getCalendarObject()->getTimeZone()->getId());
22+
echo "\n";
23+
}
24+
25+
$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk');
26+
d($df);
27+
28+
29+
//changing the calendar with a cal type should not change tz
30+
$df->setCalendar(IntlDateFormatter::TRADITIONAL);
31+
d($df);
32+
33+
//but changing with an actual calendar should
34+
$cal = IntlCalendar::createInstance("UTC");
35+
$df->setCalendar($cal);
36+
d($df);
37+
38+
?>
39+
--EXPECT--
40+
dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 heure de Kaliningrad
41+
int(1)
42+
string(9) "gregorian"
43+
string(12) "Europe/Minsk"
44+
45+
dimanche 8 safar 1433 AH à 03:00:00 heure de Kaliningrad
46+
int(0)
47+
string(7) "islamic"
48+
string(12) "Europe/Minsk"
49+
50+
dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 temps universel coordonné
51+
bool(false)
52+
string(9) "gregorian"
53+
string(3) "UTC"
54+

0 commit comments

Comments
 (0)