summaryrefslogtreecommitdiff
path: root/devel-utf8/tests/autoprepend.t
diff options
context:
space:
mode:
Diffstat (limited to 'devel-utf8/tests/autoprepend.t')
-rwxr-xr-xdevel-utf8/tests/autoprepend.t38
1 files changed, 38 insertions, 0 deletions
diff --git a/devel-utf8/tests/autoprepend.t b/devel-utf8/tests/autoprepend.t
new file mode 100755
index 0000000..bf40605
--- /dev/null
+++ b/devel-utf8/tests/autoprepend.t
@@ -0,0 +1,38 @@
+#!/www/server/bin/php -qC
+<?php
+
+it_text::init();
+$GLOBALS['it_text']->statictext = array(
+ '_' => array("de" => "Deutsch", "en" => "English"),
+ 'foo' => array("de" => "bar {v1}", "en" => "qux {v1}"),
+);
+
+is(
+ T('foo'),
+ "bar {v1}",
+ "simple T()"
+);
+
+is(
+ T('foo', 'en'),
+ "qux {v1}",
+ "simple T() with language"
+);
+
+is(
+ T('foo', array('v1' => "gna<bber")),
+ "bar gna&lt;bber",
+ "T() with quoted values"
+);
+
+is(
+ T('foo', array('v1' => "gna<bber"), 'en'),
+ "qux gna&lt;bber",
+ "T() with with quoted values and language"
+);
+
+is(
+ T('foo', 'en', array('v1' => "gna<bber")),
+ "qux gna&lt;bber",
+ "T() with with language and quoted values"
+);