aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-04-25 07:24:50 -0700
committerCesar G <prototech91@gmail.com>2014-04-25 07:24:50 -0700
commitfefd6b7423654dd7297667132e1fd232954ccd3c (patch)
tree66d10a00752199d086cc943b6577405220bf37a3 /tests
parentc61f92eb46452bb294c9cec8394ef68a19f466ff (diff)
parent91eaae122f2671d14b5f83481c883daeaffed693 (diff)
downloadforums-fefd6b7423654dd7297667132e1fd232954ccd3c.tar
forums-fefd6b7423654dd7297667132e1fd232954ccd3c.tar.gz
forums-fefd6b7423654dd7297667132e1fd232954ccd3c.tar.bz2
forums-fefd6b7423654dd7297667132e1fd232954ccd3c.tar.xz
forums-fefd6b7423654dd7297667132e1fd232954ccd3c.zip
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
Diffstat (limited to 'tests')
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html2
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html3
-rw-r--r--tests/template/template_events_test.php21
-rw-r--r--tests/template/template_test.php19
-rw-r--r--tests/template/templates/loop_nested_include.html4
-rw-r--r--tests/template/templates/loop_nested_include1.html5
6 files changed, 52 insertions, 2 deletions
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
new file mode 100644
index 0000000000..4fdba859f3
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
@@ -0,0 +1,2 @@
+[{event_loop.S_ROW_COUNT}<!-- BEGIN subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
+<!-- END subloop -->]
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
new file mode 100644
index 0000000000..233b32a4c7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_subloop -->
+<!-- END event_loop -->
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 41e00e86a7..d09f22944f 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -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);
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 74baa3d5b6..49804c26c5 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -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);
}
diff --git a/tests/template/templates/loop_nested_include.html b/tests/template/templates/loop_nested_include.html
new file mode 100644
index 0000000000..eaad46cc5b
--- /dev/null
+++ b/tests/template/templates/loop_nested_include.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+[{test_loop.foo}
+ |<!-- INCLUDE loop_nested_include1.html -->]
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_nested_include1.html b/tests/template/templates/loop_nested_include1.html
new file mode 100644
index 0000000000..0f1a180b4d
--- /dev/null
+++ b/tests/template/templates/loop_nested_include1.html
@@ -0,0 +1,5 @@
+[{test_loop.foo}|
+<!-- BEGIN inner -->
+[{test_loop.foo}|
+{test_loop.inner.myinner}]
+<!-- END inner -->]