php-src/ext/intl/tests/calendar_createInstance_variation1.phpt
2012-04-01 23:28:01 +01:00

84 lines
1.7 KiB
PHP

--TEST--
IntlCalendar::createInstance() argument variations
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
die('skip for ICU 4.8+');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
$cal = intlcal_create_instance('Europe/Amsterdam');
print_R($cal->getTimeZone());
print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
echo "\n";
$cal = intlcal_create_instance('Europe/Lisbon', null);
print_R($cal->getTimeZone());
print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
echo "\n";
$cal = intlcal_create_instance(IntlTimeZone::createTimeZone('Europe/Lisbon'));
print_R($cal->getTimeZone());
print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
echo "\n";
$cal = intlcal_create_instance(null, "pt");
print_R($cal->getTimeZone());
print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
echo "\n";
$cal = intlcal_create_instance("Europe/Lisbon", "pt");
print_R($cal->getTimeZone());
print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
echo "\n";
?>
==DONE==
--EXPECTF--
IntlTimeZone Object
(
[valid] => 1
[id] => Europe/Amsterdam
[rawOffset] => 3600000
[currentOffset] => %d
)
nl
IntlTimeZone Object
(
[valid] => 1
[id] => Europe/Lisbon
[rawOffset] => 0
[currentOffset] => %d
)
nl
IntlTimeZone Object
(
[valid] => 1
[id] => Europe/Lisbon
[rawOffset] => 0
[currentOffset] => %d
)
nl
IntlTimeZone Object
(
[valid] => 1
[id] => Europe/Amsterdam
[rawOffset] => 3600000
[currentOffset] => %d
)
pt
IntlTimeZone Object
(
[valid] => 1
[id] => Europe/Lisbon
[rawOffset] => 0
[currentOffset] => %d
)
pt
==DONE==