summaryrefslogtreecommitdiff
path: root/devel-utf8/tests/it_text.t
diff options
context:
space:
mode:
authorNathan Gass2012-03-22 18:18:42 +0000
committerNathan Gass2012-03-22 18:18:42 +0000
commitd59a4921188753dbe4c0161081755a28112c3ef6 (patch)
tree81496414d988f37f1db9d92c9750d888ffa13746 /devel-utf8/tests/it_text.t
parentca11771e8fad5fef96615df4c44e04b8fb60ac31 (diff)
downloaditools-d59a4921188753dbe4c0161081755a28112c3ef6.tar.gz
itools-d59a4921188753dbe4c0161081755a28112c3ef6.tar.bz2
itools-d59a4921188753dbe4c0161081755a28112c3ef6.zip
Branch itools/devel-utf8 created
Diffstat (limited to 'devel-utf8/tests/it_text.t')
-rwxr-xr-xdevel-utf8/tests/it_text.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/devel-utf8/tests/it_text.t b/devel-utf8/tests/it_text.t
new file mode 100755
index 0000000..bc4d5c0
--- /dev/null
+++ b/devel-utf8/tests/it_text.t
@@ -0,0 +1,18 @@
+#!/www/server/bin/php
+<?php
+
+$obj->x = "attr";
+$obj->y->z = "attr";
+
+is(it_text::transmogrify(""), "");
+is(it_text::transmogrify("foo"), "foo");
+is(it_text::transmogrify("{foo}"), "");
+is(it_text::transmogrify("{foo}", array('foo' => 1)), "1");
+is(it_text::transmogrify("{foo}{foo}", array('foo' => 1)), "11");
+is(it_text::transmogrify("{foo}X", array('foo' => 1)), "1X");
+is(it_text::transmogrify("{foo}X{foo}", array('foo' => 1)), "1X1");
+is(it_text::transmogrify("X{foo}", array('foo' => 1)), "X1");
+is(it_text::transmogrify("X{foo}{bar}", array('foo' => 1, 'bar' => 2)), "X12");
+is(it_text::transmogrify("X{foo}", array('foo' => "&")), "X&");
+is(it_text::transmogrify("X{x}", $obj), "Xattr");
+is(it_text::transmogrify("X{y.z}", $obj), "Xattr");