diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-04-01 12:04:48 +0200 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-04-01 23:28:00 +0100 |
commit | 7460741f991aa646e54456ef022676ca184b54fe (patch) | |
tree | b6d02dab6669eea2fbb252423157387ecfff6ac8 /ext | |
parent | 5e65205a8f52d25635bb4e7619a4b0216aefa4b8 (diff) | |
download | php-git-7460741f991aa646e54456ef022676ca184b54fe.tar.gz |
Fix TimeZone tests failing due to new data in ICU 49.
Diffstat (limited to 'ext')
6 files changed, 77 insertions, 7 deletions
diff --git a/ext/intl/tests/timezone_getDisplayName_basic.phpt b/ext/intl/tests/timezone_getDisplayName_basic.phpt index 0c485ffc43..e4fc2f37ce 100644 --- a/ext/intl/tests/timezone_getDisplayName_basic.phpt +++ b/ext/intl/tests/timezone_getDisplayName_basic.phpt @@ -18,7 +18,7 @@ var_dump($lsb->getDisplayName()); ?> ==DONE== ---EXPECT-- -string(21) "Western European Time" -string(24) "Hora da Europa Ocidental" +--EXPECTF-- +string(%d) "Western European%sTime" +string(%d) "Hora%sda Europa Ocidental" ==DONE==
\ No newline at end of file diff --git a/ext/intl/tests/timezone_getDisplayName_variant1.phpt b/ext/intl/tests/timezone_getDisplayName_variant1.phpt index 3f38344b0e..83922dd170 100644 --- a/ext/intl/tests/timezone_getDisplayName_variant1.phpt +++ b/ext/intl/tests/timezone_getDisplayName_variant1.phpt @@ -19,8 +19,8 @@ var_dump($lsb->getDisplayName(true)); ?> ==DONE== ---EXPECT-- -string(21) "Western European Time" -string(21) "Western European Time" +--EXPECTF-- +string(%d) "Western European%sTime" +string(%d) "Western European%sTime" string(28) "Western European Summer Time" ==DONE==
\ No newline at end of file diff --git a/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt b/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt new file mode 100644 index 0000000000..4ee30aee12 --- /dev/null +++ b/ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt @@ -0,0 +1,38 @@ +--TEST-- +IntlTimeZone::getDisplayName(): type parameter (ICU >= 49) +--SKIPIF-- +<?php +if (!extension_loaded('intl')) + die('skip intl extension not enabled'); +if (version_compare(INTL_ICU_VERSION, '49') < 0) + die('skip for ICU 49+'); +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("error_reporting", -1); +ini_set("display_errors", 1); + +$lsb = IntlTimeZone::createTimeZone('Europe/Lisbon'); + +ini_set('intl.default_locale', 'en_US'); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GENERIC)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GENERIC)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GMT)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GMT)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_COMMONLY_USED)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_GENERIC_LOCATION)); + +?> +==DONE== +--EXPECT-- +string(3) "GMT" +string(30) "Western European Standard Time" +string(22) "Portugal Time (Lisbon)" +string(21) "Western European Time" +string(5) "+0000" +string(3) "GMT" +string(3) "GMT" +string(22) "Portugal Time (Lisbon)" +==DONE==
\ No newline at end of file diff --git a/ext/intl/tests/timezone_getDisplayName_variant2.phpt b/ext/intl/tests/timezone_getDisplayName_variant2.phpt index aa452dadad..fd03550467 100644 --- a/ext/intl/tests/timezone_getDisplayName_variant2.phpt +++ b/ext/intl/tests/timezone_getDisplayName_variant2.phpt @@ -1,9 +1,11 @@ --TEST-- -IntlTimeZone::getDisplayName(): type parameter +IntlTimeZone::getDisplayName(): type parameter (ICU < 49) --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); +if (version_compare(INTL_ICU_VERSION, '49') >= 0) + die('skip for ICU < 49'); --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/timezone_getDisplayName_variant3-49+.phpt b/ext/intl/tests/timezone_getDisplayName_variant3-49+.phpt new file mode 100644 index 0000000000..e90cc4748c --- /dev/null +++ b/ext/intl/tests/timezone_getDisplayName_variant3-49+.phpt @@ -0,0 +1,28 @@ +--TEST-- +IntlTimeZone::getDisplayName(): locale parameter +--SKIPIF-- +<?php +if (!extension_loaded('intl')) + die('skip intl extension not enabled'); +if (version_compare(INTL_ICU_VERSION, '49') < 0) + die('skip for ICU 49+'); +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("error_reporting", -1); +ini_set("display_errors", 1); + +$lsb = IntlTimeZone::createTimeZone('Europe/Lisbon'); + +ini_set('intl.default_locale', 'en_US'); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, NULL)); +var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, 'pt_PT')); + +?> +==DONE== +--EXPECT-- +string(30) "Western European Standard Time" +string(30) "Western European Standard Time" +string(32) "Hora Padrão da Europa Ocidental" +==DONE== diff --git a/ext/intl/tests/timezone_getDisplayName_variant3.phpt b/ext/intl/tests/timezone_getDisplayName_variant3.phpt index 41cab8d0b6..c160777583 100644 --- a/ext/intl/tests/timezone_getDisplayName_variant3.phpt +++ b/ext/intl/tests/timezone_getDisplayName_variant3.phpt @@ -4,6 +4,8 @@ IntlTimeZone::getDisplayName(): locale parameter <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); +if (version_compare(INTL_ICU_VERSION, '49') >= 0) + die('skip for ICU <= 4.8'); --FILE-- <?php ini_set("intl.error_level", E_WARNING); |