php-src/ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt
Nikita Popov c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00

34 lines
861 B
PHP

--TEST--
IntlTimeZone::getErrorCode/Message(): basic test
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
/* INF being an invalid offset depends on UB in float->int cast behavior. */
$arch = php_uname('m');
if ($arch != 'x86_64' && $arch != 'i386')
die('skip requires x86');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
var_dump($lsb->getErrorCode());
var_dump($lsb->getErrorMessage());
var_dump($lsb->getOffset(INF, 1, $a, $b));
var_dump($lsb->getErrorCode());
var_dump($lsb->getErrorMessage());
?>
--EXPECTF--
int(0)
string(12) "U_ZERO_ERROR"
Warning: IntlTimeZone::getOffset(): intltz_get_offset: error obtaining offset in %s on line %d
bool(false)
int(1)
string(67) "intltz_get_offset: error obtaining offset: U_ILLEGAL_ARGUMENT_ERROR"