Skip to content

Commit 761106a

Browse files
committed
add test
1 parent 8ab1846 commit 761106a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

ext/intl/tests/gh19261.phpt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
MessageFormatter::parseMessage() with invalid locale
3+
--EXTENSIONS--
4+
intl
5+
--CREDITS--
6+
7+
--FILE--
8+
<?php
9+
10+
$locale = 'root';
11+
$fmt = '{0,whatever} would not work!';
12+
13+
$str = 'failing';
14+
15+
$m = MessageFormatter::parseMessage($locale, $fmt, $str);
16+
var_dump($m);
17+
var_dump(intl_get_error_message());
18+
19+
$m = msgfmt_parse_message($locale, $fmt, $str);
20+
var_dump($m);
21+
var_dump(intl_get_error_message());
22+
23+
?>
24+
--EXPECT--
25+
bool(false)
26+
string(59) "Creating message formatter failed: U_ILLEGAL_ARGUMENT_ERROR"
27+
bool(false)
28+
string(59) "Creating message formatter failed: U_ILLEGAL_ARGUMENT_ERROR"

0 commit comments

Comments
 (0)