From eeb26db00c41f8aae3c96404a898cd2ae4a317ee Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 14 Sep 2011 13:25:45 +0000 Subject: fix endless loop, improve performance --- tests/it_text.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tests/it_text.t (limited to 'tests') diff --git a/tests/it_text.t b/tests/it_text.t new file mode 100755 index 0000000..bc4d5c0 --- /dev/null +++ b/tests/it_text.t @@ -0,0 +1,18 @@ +#!/www/server/bin/php +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"); -- cgit v1.2.3