summaryrefslogtreecommitdiff
path: root/ext/gettext/tests/gettext_ngettext-wrongparams.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gettext/tests/gettext_ngettext-wrongparams.phpt')
-rw-r--r--ext/gettext/tests/gettext_ngettext-wrongparams.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/gettext/tests/gettext_ngettext-wrongparams.phpt b/ext/gettext/tests/gettext_ngettext-wrongparams.phpt
new file mode 100644
index 0000000000..9003aefcfe
--- /dev/null
+++ b/ext/gettext/tests/gettext_ngettext-wrongparams.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Check how ngettext() with wrong parameters behaves.
+--SKIPIF--
+<?php
+ if (!extension_loaded("gettext")) {
+ die("SKIP extension gettext not loaded\n");
+ }
+
+?>
+--FILE--
+<?php
+ngettext(array(), "", 1);
+ngettext("", array(), 1);
+ngettext("", "", array());
+ngettext();
+ngettext("");
+ngettext("", "");
+?>
+--EXPECTF--
+Warning: ngettext() expects parameter 1 to be string, array given in %s on line 2
+
+Warning: ngettext() expects parameter 2 to be string, array given in %s on line 3
+
+Warning: ngettext() expects parameter 3 to be long, array given in %s on line 4
+
+Warning: ngettext() expects exactly 3 parameters, 0 given in %s on line 5
+
+Warning: ngettext() expects exactly 3 parameters, 1 given in %s on line 6
+
+Warning: ngettext() expects exactly 3 parameters, 2 given in %s on line 7
+--CREDITS--
+Tim Eggert, tim@elbart.com
+PHP Testfest Berlin 2009-05-09