php-src/ext/intl/tests/timezone_createTimeZoneIDEnumeration_error.phpt
Gina Peter Banyard 43420599f7
ext/intl: better errors for IntlTimeZone::createTimeZoneIDEnumeration (#19395)
IntlTimeZone::createTimeZoneIDEnumeration

And convert those to ValueErrors directly as they are bugs
2025-08-07 13:52:03 +01:00

16 lines
450 B
PHP

--TEST--
IntlTimeZone::createTimeZoneIDEnumeration() invalid zone type
--EXTENSIONS--
intl
--FILE--
<?php
try {
var_dump(IntlTimeZone::createTimeZoneIDEnumeration(-1));
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
ValueError: IntlTimeZone::createTimeZoneIDEnumeration(): Argument #1 ($type) must be one of IntlTimeZone::TYPE_ANY, IntlTimeZone::TYPE_CANONICAL, or IntlTimeZone::TYPE_CANONICAL_LOCATION