Stub out gettext functions if they don't exist to avoid fatal errors in tests.
authorChuck Hagenbuch <chuck@horde.org>
Sun, 4 Oct 2009 02:57:40 +0000 (22:57 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sun, 4 Oct 2009 03:01:33 +0000 (23:01 -0400)
framework/bin/test_framework

index 791c95e..23fcd4a 100755 (executable)
@@ -79,3 +79,28 @@ class horde_test_runner
         return $suite;
     }
 }
+
+/* Stand-in functions if gettext is not available. */
+if (!function_exists('_')) {
+    function _($string)
+    {
+        return $string;
+    }
+}
+
+if (!function_exists('ngettext')) {
+    function ngettext($msgid1, $msgid2, $n)
+    {
+        return $n > 1 ? $msgid2 : $msgid1;
+    }
+}
+
+if (!function_exists('bindtextdomain')) {
+    function bindtextdomain()
+    {}
+}
+
+if (!function_exists('textdomain')) {
+    function textdomain()
+    {}
+}