com php-src: split dateformat_timezone_arg_variations*. phpt for ICU 54.1: ext/intl/tests/dateformat _timezone_arg_variations2.phpt
ext/intl/tests/datef ormat_timezone_arg_variations3.phpt ext/intl/tests/ dateformat_timezone_arg_variations4.phpt
| From: | Anatol Belski | Date: | Thu, 20 Nov 2014 12:12:02 +0000 |
| Subject: | com php-src: split dateformat_timezone_arg_variations*. phpt for ICU 54.1: ext/intl/tests/dateformat _timezone_arg_variations2.phpt ext/intl/tests/datef ormat_timezone_arg_variations3.phpt ext/intl/tests/ dateformat_timezone_arg_variations4.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83173@lists.php.net to get a copy of this message | ||
Commit: 2ec7f04f7e5996908d5a48c0eadc03afb2d02cd5
Author: Anatol Belski <ab@php.net> Thu, 20 Nov 2014 13:12:02 +0100
Parents: a52ff5cde61ffd1fb413cc470c5e23d8dac5d1d9
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2ec7f04f7e5996908d5a48c0eadc03afb2d02cd5
Log:
split dateformat_timezone_arg_variations*.phpt for ICU 54.1
Changed paths:
M ext/intl/tests/dateformat_timezone_arg_variations2.phpt
A ext/intl/tests/dateformat_timezone_arg_variations3.phpt
A ext/intl/tests/dateformat_timezone_arg_variations4.phpt
Diff:
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations2.phpt
b/ext/intl/tests/dateformat_timezone_arg_variations2.phpt
index a957963..53ee820 100644
--- a/ext/intl/tests/dateformat_timezone_arg_variations2.phpt
+++ b/ext/intl/tests/dateformat_timezone_arg_variations2.phpt
@@ -3,7 +3,7 @@ IntlDateFormatter: several forms of the timezone arg
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
-<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU
>= 51.2'); ?>
+<?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'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations3.phpt
b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt
new file mode 100644
index 0000000..f8aaf2b
--- /dev/null
+++ b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt
@@ -0,0 +1,46 @@
+--TEST--
+IntlDateFormatter: several forms of the timezone arg
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU
>= 52.1'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU
< 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+//should use Atlantic/Azores
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL);
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam');
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0,
IntlTimeZone::createTimeZone('America/New_York'));
+echo $df->format($ts), "\n";
+
+//time zone has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new
IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+//calendar has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new
IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
+echo $df->format($ts), "\n";
+
+--EXPECTF--
+sábado%S 31 de diciembre de 2011, 23:00:00 (Hora estándar de las Azores)
+domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central)
+domingo%S 1 de enero de 2012, 0:00:00 (Hora%S estándar de Europa occidental)
+sábado%S 31 de diciembre de 2011, 19:00:00 (Hora estándar oriental)
+domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central)
+domingo%S 1 de enero de 2012, 0:00:00 (Hora%S estándar de Europa occidental)
+domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central)
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations4.phpt
b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt
new file mode 100644
index 0000000..7be709a
--- /dev/null
+++ b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt
@@ -0,0 +1,46 @@
+--TEST--
+IntlDateFormatter: several forms of the timezone arg
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
+<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU
>= 54.1'); ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+//should use Atlantic/Azores
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL);
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam');
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0,
IntlTimeZone::createTimeZone('America/New_York'));
+echo $df->format($ts), "\n";
+
+//time zone has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new
IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+//calendar has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new
IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
+echo $df->format($ts), "\n";
+
+--EXPECTF--
+sábado, 31 de diciembre de 2011, 23:00:00 (hora estándar de las Azores)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental)
+sábado, 31 de diciembre de 2011, 19:00:00 (hora estándar oriental)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental)
+domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
+