mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
Merge remote-tracking branch 'nickvergessen/ticket/12382' into develop-ascraeus
* nickvergessen/ticket/12382: [ticket/12382] Mark broken nested loop with include as incomplete [ticket/12382] Add template test for subloops inside includes [ticket/12382] Add template test for subloops inside events
This commit is contained in:
commit
fefd6b7423
@ -0,0 +1,2 @@
|
|||||||
|
[{event_loop.S_ROW_COUNT}<!-- BEGIN subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
|
||||||
|
<!-- END subloop -->]
|
@ -0,0 +1,3 @@
|
|||||||
|
<!-- BEGIN event_loop -->
|
||||||
|
event_loop<!-- EVENT test_event_subloop -->
|
||||||
|
<!-- END event_loop -->
|
@ -90,14 +90,33 @@ Zeta test event in all',
|
|||||||
array(),
|
array(),
|
||||||
'event_loop0|event_loop1|event_loop2',
|
'event_loop0|event_loop1|event_loop2',
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'EVENT with subloop in loop',
|
||||||
|
'ext_trivial',
|
||||||
|
array('silver'),
|
||||||
|
'event_subloop.html',
|
||||||
|
array(),
|
||||||
|
array(
|
||||||
|
'event_loop' => array(array()),
|
||||||
|
'event_loop.subloop' => array(array()),
|
||||||
|
),
|
||||||
|
array(),
|
||||||
|
'event_loop[0[subloop:0]]',
|
||||||
|
'Event files are missing opened parent loops: PHPBB3-12382',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider template_data
|
* @dataProvider template_data
|
||||||
*/
|
*/
|
||||||
public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected)
|
public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected, $incomplete_message = '')
|
||||||
{
|
{
|
||||||
|
if ($incomplete_message)
|
||||||
|
{
|
||||||
|
$this->markTestIncomplete($incomplete_message);
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the engine state
|
// Reset the engine state
|
||||||
$this->setup_engine_for_events($dataset, $style_names);
|
$this->setup_engine_for_events($dataset, $style_names);
|
||||||
|
|
||||||
|
@ -320,6 +320,18 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
|||||||
array(),
|
array(),
|
||||||
"barbarbar1bar1",
|
"barbarbar1bar1",
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'loop_nested_include.html',
|
||||||
|
array(),
|
||||||
|
array(
|
||||||
|
'test_loop' => array(array('foo' => 'bar'), array('foo' => 'bar1')),
|
||||||
|
'test_loop.inner' => array(array('myinner' => 'works')),
|
||||||
|
),
|
||||||
|
array(),
|
||||||
|
"[bar|[bar|]][bar1|[bar1|[bar1|works]]]",
|
||||||
|
array(),
|
||||||
|
'Included files are missing opened parent loops: PHPBB3-12382',
|
||||||
|
),
|
||||||
/* Does not pass with the current implementation.
|
/* Does not pass with the current implementation.
|
||||||
array(
|
array(
|
||||||
'loop_reuse.html',
|
'loop_reuse.html',
|
||||||
@ -363,8 +375,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
|||||||
/**
|
/**
|
||||||
* @dataProvider template_data
|
* @dataProvider template_data
|
||||||
*/
|
*/
|
||||||
public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array())
|
public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array(), $incomplete_message = '')
|
||||||
{
|
{
|
||||||
|
if ($incomplete_message)
|
||||||
|
{
|
||||||
|
$this->markTestIncomplete($incomplete_message);
|
||||||
|
}
|
||||||
|
|
||||||
$this->run_template($file, $vars, $block_vars, $destroy, $expected, $lang_vars);
|
$this->run_template($file, $vars, $block_vars, $destroy, $expected, $lang_vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
tests/template/templates/loop_nested_include.html
Normal file
4
tests/template/templates/loop_nested_include.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<!-- BEGIN test_loop -->
|
||||||
|
[{test_loop.foo}
|
||||||
|
|<!-- INCLUDE loop_nested_include1.html -->]
|
||||||
|
<!-- END test_loop -->
|
5
tests/template/templates/loop_nested_include1.html
Normal file
5
tests/template/templates/loop_nested_include1.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[{test_loop.foo}|
|
||||||
|
<!-- BEGIN inner -->
|
||||||
|
[{test_loop.foo}|
|
||||||
|
{test_loop.inner.myinner}]
|
||||||
|
<!-- END inner -->]
|
Loading…
x
Reference in New Issue
Block a user