com php-src: split dateformat_create_cal_arg_variant2 .phpt for ICU 53.1 and 54.1: ex t/intl/tests/dateformat_create_cal_arg_variant2.php t
ext/intl/tests/dateformat_create_cal_arg_variant3 .phpt ext/intl/tests/dateformat_create_cal_arg_vari ant4.phpt

From: Date: Thu, 20 Nov 2014 11:39:52 +0000
Subject: com php-src: split dateformat_create_cal_arg_variant2 .phpt for ICU 53.1 and 54.1: ex t/intl/tests/dateformat_create_cal_arg_variant2.php t
ext/intl/tests/dateformat_create_cal_arg_variant3 .phpt ext/intl/tests/dateformat_create_cal_arg_vari ant4.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-83182@lists.php.net to get a copy of this message
Commit: 54af2787622616a363b35cf59e8c336ecf2ca9c0 Author: Anatol Belski <ab@php.net> Thu, 20 Nov 2014 12:39:52 +0100 Parents: b61dba5e1deb5e586cf2be27f0cf0bb126fb5ccd Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=54af2787622616a363b35cf59e8c336ecf2ca9c0 Log: split dateformat_create_cal_arg_variant2.phpt for ICU 53.1 and 54.1 Changed paths: M ext/intl/tests/dateformat_create_cal_arg_variant2.phpt A ext/intl/tests/dateformat_create_cal_arg_variant3.phpt A ext/intl/tests/dateformat_create_cal_arg_variant4.phpt Diff: diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt index 70b8620..77ec530 100644 --- a/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt +++ b/ext/intl/tests/dateformat_create_cal_arg_variant2.phpt @@ -3,7 +3,7 @@ IntlDateFormatter: several forms of the calendar 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_create_cal_arg_variant3.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt new file mode 100644 index 0000000..1beff14 --- /dev/null +++ b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt @@ -0,0 +1,54 @@ +--TEST-- +IntlDateFormatter: several forms of the calendar 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("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic'); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +//override calendar's timezone +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal); +echo $df->format($ts), "\n"; + +//default calendar is gregorian +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0); +echo $df->format($ts), "\n"; + +//try now with traditional +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +//the timezone can be overridden when not specifying a calendar +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0); +echo $df->format($ts), "\n"; + +?> +==DONE== +--EXPECTF-- +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +domingo%S 8 de Safar de 1433, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central) +sábado%S 31 de diciembre de 2011 d. C., 23:00:00 (Hora estándar %Sde las Azores) +sábado%S 7 de Safar de 1433 AH, 23:00:00 (Hora estándar %Sde las Azores) +domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +==DONE== diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt new file mode 100644 index 0000000..4086e45 --- /dev/null +++ b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt @@ -0,0 +1,53 @@ +--TEST-- +IntlDateFormatter: several forms of the calendar 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("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic'); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +//override calendar's timezone +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal); +echo $df->format($ts), "\n"; + +//default calendar is gregorian +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0); +echo $df->format($ts), "\n"; + +//try now with traditional +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +//the timezone can be overridden when not specifying a calendar +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0); +echo $df->format($ts), "\n"; + +?> +==DONE== +--EXPECTF-- +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +domingo%S 8 de Safar de 1433, 0:00:00 (GMT) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +sábado, 31 de diciembre de 2011 d. C., 23:00:00 (hora estándar de las Azores) +sábado, 7 de Safar de 1433 AH, 23:00:00 (hora estándar de las Azores) +domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +==DONE==

« previous php.cvs (#83182) next »