diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/autoprepend.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/autoprepend.t b/tests/autoprepend.t new file mode 100755 index 0000000..e91996f --- /dev/null +++ b/tests/autoprepend.t @@ -0,0 +1,40 @@ +#!/www/server/bin/php -qC +<?php + +require "searchlib/search_test.class"; + +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', 'v1' => "gna<bber"), + "bar gna<bber", + "T() with quoted values", +); + +is( + T('foo', 'v1' => "gna<bber", 'en'), + "qux gna<bber", + "T() with with quoted values and language", +); + +is( + T('foo', 'en', 'v1' => "gna<bber"), + "qux gna<bber", + "T() with with language and quoted values", +); |