php-src/ext/intl/tests/timezone_getOffset_error.phpt
Gina Peter Banyard c42e6d62d8
ext/intl: modernize tests (#19392)
This is effectively removing ZPP tests, enabling warnings, and moving INI settings into the INI PHPT block
2025-08-06 23:33:48 +01:00

22 lines
513 B
PHP

--TEST--
IntlTimeZone::getOffset(): errors
--EXTENSIONS--
intl
--SKIPIF--
<?php
/* 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
$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
var_dump($tz->getOffset(INF, true, $a, $a));
echo intl_get_error_message(), PHP_EOL;
?>
--EXPECT--
bool(false)
IntlTimeZone::getOffset(): error obtaining offset: U_ILLEGAL_ARGUMENT_ERROR