summaryrefslogtreecommitdiff
path: root/ext/gettext/tests/gettext_dngettext-plural.phpt
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2009-06-18 07:29:09 +0000
committerZoe Slattery <zoe@php.net>2009-06-18 07:29:09 +0000
commitb928d971b5f4e87d130980ee7bd59814da0b2356 (patch)
treea7e9606d755a9cd62c3636cd87fac2ef48bf8952 /ext/gettext/tests/gettext_dngettext-plural.phpt
parent269df474bf27b1543a11f48642b2e0750ce0968b (diff)
downloadphp-git-b928d971b5f4e87d130980ee7bd59814da0b2356.tar.gz
Tests from Berlin test fest
Diffstat (limited to 'ext/gettext/tests/gettext_dngettext-plural.phpt')
-rw-r--r--ext/gettext/tests/gettext_dngettext-plural.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/gettext/tests/gettext_dngettext-plural.phpt b/ext/gettext/tests/gettext_dngettext-plural.phpt
new file mode 100644
index 0000000000..0417c0ed52
--- /dev/null
+++ b/ext/gettext/tests/gettext_dngettext-plural.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test if dngettext() returns the correct translations (optionally plural).
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+ die("skip gettext extension is not loaded.\n");
+}
+if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
+ die("skip en_US.UTF-8 locale not supported.");
+}
+--FILE--
+<?php
+chdir(dirname(__FILE__));
+setlocale(LC_ALL, 'en_US.UTF-8');
+bindtextdomain('dngettextTest', './locale');
+
+var_dump(dngettext('dngettextTest', 'item', 'items', 1));
+var_dump(dngettext('dngettextTest', 'item', 'items', 2));
+--EXPECT--
+string(7) "Produkt"
+string(8) "Produkte"
+--CREDITS--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09 \ No newline at end of file