1
0
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:
Cesar G 2014-04-25 07:24:50 -07:00
commit fefd6b7423
6 changed files with 52 additions and 2 deletions

View File

@ -0,0 +1,2 @@
[{event_loop.S_ROW_COUNT}<!-- BEGIN subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
<!-- END subloop -->]

View File

@ -0,0 +1,3 @@
<!-- BEGIN event_loop -->
event_loop<!-- EVENT test_event_subloop -->
<!-- END event_loop -->

View File

@ -90,14 +90,33 @@ Zeta test event in all',
array(),
'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
*/
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
$this->setup_engine_for_events($dataset, $style_names);

View File

@ -320,6 +320,18 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(),
"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.
array(
'loop_reuse.html',
@ -363,8 +375,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
/**
* @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);
}

View File

@ -0,0 +1,4 @@
<!-- BEGIN test_loop -->
[{test_loop.foo}
|<!-- INCLUDE loop_nested_include1.html -->]
<!-- END test_loop -->

View File

@ -0,0 +1,5 @@
[{test_loop.foo}|
<!-- BEGIN inner -->
[{test_loop.foo}|
{test_loop.inner.myinner}]
<!-- END inner -->]