mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11323] Add tests for inclusion of defined variables
This adds 2 tests for the template engine. The test using include_define_variable.html will test if a defined variable, which was defined with another template variable, can be used to include a file. The second test will do the same inside a loop using a loop variable. PHPBB3-11323
This commit is contained in:
parent
3c542b852a
commit
4c50a35b62
3 changed files with 22 additions and 1 deletions
|
@ -238,7 +238,22 @@ class phpbb_template_template_test extends phpbb_test_case
|
||||||
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
|
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
|
||||||
array('loop'),
|
array('loop'),
|
||||||
'',
|
'',
|
||||||
),/* no top level nested loops
|
),
|
||||||
|
array(
|
||||||
|
'include_define_variable.html',
|
||||||
|
array('VARIABLE' => 'variable.html'),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
'variable.html',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'include_loop_define.html',
|
||||||
|
array('VARIABLE' => 'value'),
|
||||||
|
array('loop' => array(array('NESTED_FILE' => 'variable.html'))),
|
||||||
|
array(),
|
||||||
|
'value',
|
||||||
|
),
|
||||||
|
/* no top level nested loops
|
||||||
array(
|
array(
|
||||||
'loop_vars.html',
|
'loop_vars.html',
|
||||||
array(),
|
array(),
|
||||||
|
|
2
tests/template/templates/include_define_variable.html
Normal file
2
tests/template/templates/include_define_variable.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- DEFINE $DEF = '{VARIABLE}' -->
|
||||||
|
<!-- INCLUDE {$DEF} -->
|
4
tests/template/templates/include_loop_define.html
Normal file
4
tests/template/templates/include_loop_define.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- BEGIN loop -->
|
||||||
|
<!-- DEFINE $DEF = '{loop.NESTED_FILE}' -->
|
||||||
|
<!-- INCLUDE {$DEF} -->
|
||||||
|
<!-- END loop -->
|
Loading…
Add table
Reference in a new issue