summaryrefslogtreecommitdiff
path: root/ext/intl/tests/timezone_getRegion_error.phpt
blob: 34911d9abc687d18f17e5d91972ca92d2a02e6e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--TEST--
IntlTimeZone::getRegion(): errors
--SKIPIF--
<?php
if (!extension_loaded('intl'))
	die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
	die('skip for ICU 4.8+');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);

var_dump(IntlTimeZone::getRegion());
var_dump(IntlTimeZone::getRegion(array()));
var_dump(IntlTimeZone::getRegion('Europe/Lisbon', 4));
var_dump(IntlTimeZone::getRegion("foo\x81"));
var_dump(IntlTimeZone::getRegion("foo"));



--EXPECTF--

Warning: IntlTimeZone::getRegion() expects exactly 1 parameter, 0 given in %s on line %d

Warning: IntlTimeZone::getRegion(): intltz_get_region: bad arguments in %s on line %d
bool(false)

Warning: IntlTimeZone::getRegion() expects parameter 1 to be string, array given in %s on line %d

Warning: IntlTimeZone::getRegion(): intltz_get_region: bad arguments in %s on line %d
bool(false)

Warning: IntlTimeZone::getRegion() expects exactly 1 parameter, 2 given in %s on line %d

Warning: IntlTimeZone::getRegion(): intltz_get_region: bad arguments in %s on line %d
bool(false)

Warning: IntlTimeZone::getRegion(): intltz_get_region: could not convert time zone id to UTF-16 in %s on line %d
bool(false)

Warning: IntlTimeZone::getRegion(): intltz_get_region: Error obtaining region in %s on line %d
bool(false)