summaryrefslogtreecommitdiff
path: root/tests/it_text.t
blob: bc4d5c0e3b9720380bc24888f10a8e589bf2c749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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");