Fix TimeZone tests failing due to new data in ICU 49.

This commit is contained in:
Gustavo André dos Santos Lopes 2012-04-01 12:04:48 +02:00
parent 5e65205a8f
commit 7460741f99
6 changed files with 77 additions and 7 deletions

View File

@ -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==

View File

@ -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==

View File

@ -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==

View File

@ -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);

View File

@ -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==

View File

@ -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);