mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 18:11:47 +02:00
[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
This commit is contained in:
@@ -295,6 +295,16 @@ class phpbb_template_template_test extends phpbb_test_case
|
|||||||
array(),
|
array(),
|
||||||
"nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
|
"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",
|
||||||
|
),
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
tests/template/templates/loop_reuse.html
Normal file
6
tests/template/templates/loop_reuse.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<!-- BEGIN one -->
|
||||||
|
{one.VAR}
|
||||||
|
<!-- BEGIN one -->
|
||||||
|
{one.one.VAR}
|
||||||
|
<!-- END one -->
|
||||||
|
<!-- END one -->
|
Reference in New Issue
Block a user