From f0b97cfdcf851eec4660412e4c061a26b921c740 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 25 Apr 2011 21:45:10 -0400 Subject: [PATCH] [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 --- tests/template/template_test.php | 10 ++++++++++ tests/template/templates/loop_reuse.html | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/template/templates/loop_reuse.html 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 @@ + + {one.VAR} + + {one.one.VAR} + +