Skip to content

Commit a72d90c

Browse files
committed
Merge remote-tracking branch 'origin/master' into str_size_and_int64
2 parents c907406 + 190c777 commit a72d90c

23 files changed

+1113
-16
lines changed

ext/curl/tests/bug61948-win32.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ open_basedir="c:/tmp"
1717
?>
1818
--EXPECTF--
1919
%a
20-
21-
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
22-
bool(false)
20+
bool(true)
2321

2422
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
2523
bool(false)

ext/intl/tests/calendar_getDayOfWeekType_basic.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ date.timezone=Atlantic/Azores
66
<?php
77
if (!extension_loaded('intl'))
88
die('skip intl extension not enabled');
9-
if (version_compare(INTL_ICU_VERSION, '4.4') < 0)
10-
die('skip for ICU 4.4+');
9+
if (version_compare(INTL_ICU_VERSION, '4.4') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0)
10+
die('skip for ICU >= 4.4 and ICU < 52.1');
1111
--FILE--
1212
<?php
1313
ini_set("intl.error_level", E_WARNING);
@@ -31,4 +31,4 @@ int(0)
3131
int(0)
3232
int(0)
3333
int(1)
34-
==DONE==
34+
==DONE==
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
IntlCalendar::getDayOfWeekType() basic test
3+
--INI--
4+
date.timezone=Atlantic/Azores
5+
--SKIPIF--
6+
<?php
7+
if (!extension_loaded('intl'))
8+
die('skip intl extension not enabled');
9+
if (version_compare(INTL_ICU_VERSION, '52.1') < 0)
10+
die('skip for ICU >= 52.1');
11+
--FILE--
12+
<?php
13+
ini_set("intl.error_level", E_WARNING);
14+
ini_set("intl.default_locale", "nl");
15+
16+
$intlcal = IntlCalendar::createInstance('UTC');
17+
$intlcal->setTime(strtotime('2012-02-29 00:00:00 +0000') * 1000);
18+
var_dump(
19+
intlcal_get_day_of_week_type($intlcal, IntlCalendar::DOW_SUNDAY),
20+
$intlcal->getDayOfWeekType(IntlCalendar::DOW_MONDAY),
21+
$intlcal->getDayOfWeekType(IntlCalendar::DOW_TUESDAY),
22+
$intlcal->getDayOfWeekType(IntlCalendar::DOW_FRIDAY),
23+
$intlcal->getDayOfWeekType(IntlCalendar::DOW_SATURDAY)
24+
);
25+
26+
?>
27+
==DONE==
28+
--EXPECT--
29+
int(1)
30+
int(0)
31+
int(0)
32+
int(0)
33+
int(1)
34+
==DONE==

ext/intl/tests/dateformat_create_cal_arg_variant2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IntlDateFormatter: several forms of the calendar arg
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6-
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?>
77
--FILE--
88
<?php
99
ini_set("intl.error_level", E_WARNING);
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
--TEST--
2+
IntlDateFormatter: several forms of the calendar arg
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
7+
--FILE--
8+
<?php
9+
ini_set("intl.error_level", E_WARNING);
10+
ini_set("intl.default_locale", "pt_PT");
11+
ini_set("date.timezone", 'Atlantic/Azores');
12+
13+
$ts = strtotime('2012-01-01 00:00:00 UTC');
14+
15+
$cal = new IntlGregorianCalendar('UTC', NULL);
16+
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
17+
echo $df->format($ts), "\n";
18+
19+
$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic');
20+
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
21+
echo $df->format($ts), "\n";
22+
23+
//override calendar's timezone
24+
$cal = new IntlGregorianCalendar('UTC', NULL);
25+
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
26+
echo $df->format($ts), "\n";
27+
28+
//default calendar is gregorian
29+
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0);
30+
echo $df->format($ts), "\n";
31+
32+
//try now with traditional
33+
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
34+
echo $df->format($ts), "\n";
35+
36+
//the timezone can be overridden when not specifying a calendar
37+
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
38+
echo $df->format($ts), "\n";
39+
40+
$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
41+
echo $df->format($ts), "\n";
42+
43+
?>
44+
==DONE==
45+
--EXPECTF--
46+
domingo%S 1 de enero de 2012, 0:00:00 (GMT)
47+
domingo%S 8 de Safar de 1433, 0:00:00 (GMT)
48+
domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central)
49+
sábado%S 31 de diciembre de 2011 d. C., 23:00:00 (Hora estándar %Sde las Azores)
50+
sábado%S 7 de Safar de 1433 AH, 23:00:00 (Hora estándar %Sde las Azores)
51+
domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT)
52+
domingo%S 1 de enero de 2012, 0:00:00 (GMT)
53+
==DONE==

ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IntlDateFormatter::formatObject(): IntlCalendar tests
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6-
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?>
77
--FILE--
88
<?php
99
ini_set("intl.error_level", E_WARNING);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--TEST--
2+
IntlDateFormatter::formatObject(): IntlCalendar tests
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
7+
--FILE--
8+
<?php
9+
ini_set("intl.error_level", E_WARNING);
10+
ini_set("intl.default_locale", "pt_PT");
11+
ini_set("date.timezone", "Europe/Lisbon");
12+
13+
$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon
14+
echo IntlDateFormatter::formatObject($cal), "\n";
15+
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
16+
echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n";
17+
echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
18+
echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
19+
20+
$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00');
21+
echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n";
22+
23+
$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil');
24+
$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.);
25+
echo IntlDateFormatter::formatObject($cal), "\n";
26+
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n";
27+
28+
?>
29+
==DONE==
30+
31+
--EXPECTF--
32+
01/01/2012, 00:00:00
33+
domingo, 1 de Janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
34+
Jan 1, 2012, 12:00:00 AM
35+
1/1/12, 12:00:00 AM Western European Standard %STime
36+
Sun 2012-01-1 00,00,00.000 Portugal Time
37+
domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00
38+
06/02/1433, 00:00:00
39+
Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time
40+
==DONE==

ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IntlDateFormatter::formatObject(): DateTime tests
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6-
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?>
77
--FILE--
88
<?php
99
ini_set("intl.error_level", E_WARNING);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
IntlDateFormatter::formatObject(): DateTime tests
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
7+
--FILE--
8+
<?php
9+
ini_set("intl.error_level", E_WARNING);
10+
ini_set("intl.default_locale", "pt_PT");
11+
ini_set("date.timezone", "Europe/Lisbon");
12+
13+
$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon
14+
echo IntlDateFormatter::formatObject($dt), "\n";
15+
echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
16+
echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n";
17+
echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
18+
echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
19+
20+
$dt = new DateTime('2012-01-01 05:00:00+03:00');
21+
echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
22+
23+
?>
24+
==DONE==
25+
26+
--EXPECTF--
27+
01/01/2012, 00:00:00
28+
domingo, 1 de Janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
29+
Jan 1, 2012, 12:00:00 AM
30+
1/1/12, 12:00:00 AM Western European Standard %STime
31+
Sun 2012-01-1 00,00,00.000 Portugal Time
32+
domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00
33+
==DONE==

ext/intl/tests/dateformat_get_set_calendar_variant2.phpt

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

ext/intl/tests/dateformat_get_set_timezone_variant2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IntlDateFormatter: get/setTimeZone()
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6-
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?>
77
--FILE--
88
<?php
99
ini_set("intl.error_level", E_WARNING);
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
--TEST--
2+
IntlDateFormatter: get/setTimeZone()
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
7+
--FILE--
8+
<?php
9+
ini_set("intl.error_level", E_WARNING);
10+
ini_set("intl.default_locale", "pt_PT");
11+
ini_set("date.timezone", 'Atlantic/Azores');
12+
13+
$ts = strtotime('2012-01-01 00:00:00 UTC');
14+
15+
function d(IntlDateFormatter $df) {
16+
global $ts;
17+
echo $df->format($ts), "\n";
18+
var_dump(
19+
$df->getTimeZoneID(),
20+
$df->getTimeZone()->getID());
21+
echo "\n";
22+
}
23+
24+
$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk');
25+
d($df);
26+
27+
$df->setTimeZone(NULL);
28+
d($df);
29+
30+
$df->setTimeZone('Europe/Madrid');
31+
d($df);
32+
33+
$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris'));
34+
d($df);
35+
36+
$df->setTimeZone(new DateTimeZone('Europe/Amsterdam'));
37+
d($df);
38+
39+
?>
40+
==DONE==
41+
--EXPECTF--
42+
domingo, 1 de Janeiro de 2012 às 03:00:00 GMT+03:00
43+
string(12) "Europe/Minsk"
44+
string(12) "Europe/Minsk"
45+
46+
sábado, 31 de Dezembro de 2011 às 23:00:00 Hor%s Padrão %Sdos Açores
47+
string(15) "Atlantic/Azores"
48+
string(15) "Atlantic/Azores"
49+
50+
domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central
51+
string(13) "Europe/Madrid"
52+
string(13) "Europe/Madrid"
53+
54+
domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central
55+
string(12) "Europe/Paris"
56+
string(12) "Europe/Paris"
57+
58+
domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central
59+
string(16) "Europe/Amsterdam"
60+
string(16) "Europe/Amsterdam"
61+
62+
==DONE==

ext/intl/tests/dateformat_timezone_arg_variations2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IntlDateFormatter: several forms of the timezone arg
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6-
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
6+
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?>
77
--FILE--
88
<?php
99
ini_set("intl.error_level", E_WARNING);

0 commit comments

Comments
 (0)