php-src/ext/intl/tests/timezone_getDisplayName_error.phpt
David CARLIER 9a3a4b5ba2
ext/intl: IntlDateFormatter class removing redundant error message info. (#13465)
Also correcting new IntlChar class constants typos.
2024-02-21 23:23:09 +00:00

22 lines
654 B
PHP

--TEST--
IntlTimeZone::getDisplayName(): errors
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
var_dump($tz->getDisplayName(false, -1));
var_dump(intltz_get_display_name(null, IntlTimeZone::DISPLAY_SHORT, false, 'pt_PT'));
?>
--EXPECTF--
Warning: IntlTimeZone::getDisplayName(): wrong display type in %s on line %d
bool(false)
Fatal error: Uncaught TypeError: intltz_get_display_name(): Argument #1 ($timezone) must be of type IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_display_name(NULL, 1, false, 'pt_PT')
#1 {main}
thrown in %s on line %d