php-src/ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

34 lines
858 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"