aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-04-25 21:45:10 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-04-25 23:19:32 -0400
commitf0b97cfdcf851eec4660412e4c061a26b921c740 (patch)
treec7106a05487d7e753ff9f119308dcfbf03fcfbea /tests/template
parentf97411b91143a0c75ef0ecec3ff03fc36a879728 (diff)
downloadforums-f0b97cfdcf851eec4660412e4c061a26b921c740.tar
forums-f0b97cfdcf851eec4660412e4c061a26b921c740.tar.gz
forums-f0b97cfdcf851eec4660412e4c061a26b921c740.tar.bz2
forums-f0b97cfdcf851eec4660412e4c061a26b921c740.tar.xz
forums-f0b97cfdcf851eec4660412e4c061a26b921c740.zip
[feature/template-engine] Added a test for reuse of loop identifiers.
This currently does not pass, thus it is commented out. The reuse appears implausible in the same file, however it may be also done across template files where it is much harder to detect. PHPBB3-9726
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/template_test.php10
-rw-r--r--tests/template/templates/loop_reuse.html6
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 5a21d2f69c..4304035192 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -295,6 +295,16 @@ class phpbb_template_template_test extends phpbb_test_case
array(),
"nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
),
+ /* Does not pass with the current implementation.
+ array(
+ 'loop_reuse.html',
+ array(),
+ array('one' => array(array('VAR' => 'a'), array('VAR' => 'b')), 'one.one' => array(array('VAR' => 'c'), array('VAR' => 'd'))),
+ array(),
+ // Not entirely sure what should be outputted but the current output of "a" is most certainly wrong
+ "a\nb\nc\nd",
+ ),
+ */
);
}
diff --git a/tests/template/templates/loop_reuse.html b/tests/template/templates/loop_reuse.html
new file mode 100644
index 0000000000..bd0354ae6f
--- /dev/null
+++ b/tests/template/templates/loop_reuse.html
@@ -0,0 +1,6 @@
+<!-- BEGIN one -->
+ {one.VAR}
+ <!-- BEGIN one -->
+ {one.one.VAR}
+ <!-- END one -->
+<!-- END one -->