Skip to content

Commit bb58985

Browse files
committed
distinct tests
1 parent 0aeab90 commit bb58985

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

ext/intl/tests/locale_get_display_language3.phpt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,6 @@ function ut_main()
7878
$res_str .= "-----------------\n";
7979
}
8080

81-
try {
82-
ut_loc_get_display_language("a-D\0E", "locale=a-DE");
83-
} catch (\ValueError $e) {
84-
echo $e->getMessage(). PHP_EOL;
85-
}
86-
87-
try {
88-
ut_loc_get_display_language("a-DE", "locale=a\0-DE");
89-
} catch (\ValueError $e) {
90-
echo $e->getMessage(). PHP_EOL;
91-
}
92-
9381
return $res_str;
9482
}
9583

@@ -98,10 +86,6 @@ ut_run();
9886

9987
?>
10088
--EXPECTREGEX--
101-
Locale::getDisplayLanguage(): Argument #1 ($locale) must not contain any null bytes
102-
Locale::getDisplayLanguage(): Argument #2 ($displayLocale) must not contain any null bytes
103-
locale_get_display_language(): Argument #1 ($locale) must not contain any null bytes
104-
locale_get_display_language(): Argument #2 ($displayLocale) must not contain any null bytes
10589
locale='art-lojban'
10690
disp_locale=en : display_language=Lojban
10791
disp_locale=fr : display_language=lojban
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
locale_get_display_language() throwing null bytes exceptions.
3+
--EXTENSIONS--
4+
intl
5+
--FILE--
6+
<?php
7+
8+
function ut_main()
9+
{
10+
try {
11+
ut_loc_get_display_language("a-D\0E", "locale=a-DE");
12+
} catch (\ValueError $e) {
13+
echo $e->getMessage(). PHP_EOL;
14+
}
15+
16+
try {
17+
ut_loc_get_display_language("a-DE", "locale=a\0-DE");
18+
} catch (\ValueError $e) {
19+
echo $e->getMessage(). PHP_EOL;
20+
}
21+
}
22+
include_once 'ut_common.inc';
23+
ut_run();
24+
?>
25+
--EXPECT--
26+
Locale::getDisplayLanguage(): Argument #1 ($locale) must not contain any null bytes
27+
Locale::getDisplayLanguage(): Argument #2 ($displayLocale) must not contain any null bytes
28+
locale_get_display_language(): Argument #1 ($locale) must not contain any null bytes
29+
locale_get_display_language(): Argument #2 ($displayLocale) must not contain any null bytes

0 commit comments

Comments
 (0)