diff options
| author | Anatol Belski <ab@php.net> | 2013-10-07 13:49:55 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2013-10-07 13:49:55 +0200 |
| commit | 0117eb747e1b36a301d58fa29aa3ae48b5aa2ac7 (patch) | |
| tree | 5708df5aad968b492295c377eace928d12f69c91 /ext/intl/tests/dateformat_timezone_arg_variations2.phpt | |
| parent | 4840b0a749454335218f6131892031333d66142d (diff) | |
| download | php-git-0117eb747e1b36a301d58fa29aa3ae48b5aa2ac7.tar.gz | |
added fixed tests for ICU >= 51.2
Diffstat (limited to 'ext/intl/tests/dateformat_timezone_arg_variations2.phpt')
| -rw-r--r-- | ext/intl/tests/dateformat_timezone_arg_variations2.phpt | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations2.phpt b/ext/intl/tests/dateformat_timezone_arg_variations2.phpt new file mode 100644 index 0000000000..a957963a44 --- /dev/null +++ b/ext/intl/tests/dateformat_timezone_arg_variations2.phpt @@ -0,0 +1,45 @@ +--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, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +--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 01:00:00 Hora estándar de Europa central +domingo%S, 1 de enero de 2012 00:00:00 Hora%S 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 01:00:00 Hora estándar de Europa central +domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental +domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central |
