xref: /PHP-8.4/ext/gettext/tests/dcngettext.phpt (revision 25c09939)
1--TEST--
2dcngettext() tests
3--EXTENSIONS--
4gettext
5--SKIPIF--
6<?php
7if (!function_exists("dcngettext")) die("skip dcngettext() doesn't exist");
8?>
9--FILE--
10<?php
11
12var_dump(dcngettext(1,1,1,1,1));
13var_dump(dcngettext("test","test","test",1,1));
14var_dump(dcngettext("test","test","test",0,1));
15var_dump(dcngettext("test","test","test",-1,-1));
16
17try {
18    dcngettext("","","",1,1);
19} catch (\ValueError $e) {
20    echo $e->getMessage() . PHP_EOL;
21}
22
23try {
24    dcngettext("","","",0,1);
25} catch (\ValueError $e) {
26    echo $e->getMessage() . PHP_EOL;
27}
28
29echo "Done\n";
30?>
31--EXPECT--
32string(1) "1"
33string(4) "test"
34string(4) "test"
35string(4) "test"
36dcngettext(): Argument #1 ($domain) must not be empty
37dcngettext(): Argument #1 ($domain) must not be empty
38Done
39