aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-09-18 22:27:22 +0200
committerNils Adermann <naderman@naderman.de>2011-09-18 22:27:22 +0200
commitbf5d453479ed572692209b7acf71f3e9c0e97cc7 (patch)
tree1c5c335abf68286e698d2ba2e9c46dcc179ffe2d /tests
parent054947adc071648ce37cbbab942282663bf322cb (diff)
parentb5a79009cebe926058b745621158a105a45648a1 (diff)
downloadforums-bf5d453479ed572692209b7acf71f3e9c0e97cc7.tar
forums-bf5d453479ed572692209b7acf71f3e9c0e97cc7.tar.gz
forums-bf5d453479ed572692209b7acf71f3e9c0e97cc7.tar.bz2
forums-bf5d453479ed572692209b7acf71f3e9c0e97cc7.tar.xz
forums-bf5d453479ed572692209b7acf71f3e9c0e97cc7.zip
Merge remote-tracking branch 'github-noxwizard/ticket/10322' into develop
* github-noxwizard/ticket/10322: [ticket/10322] Separate template varref resolution from output generation [ticket/10322] Dynamic template include test [ticket/10322] Fix dynamic template includes
Diffstat (limited to 'tests')
-rw-r--r--tests/template/template_test.php21
-rw-r--r--tests/template/templates/include_define.html2
-rw-r--r--tests/template/templates/include_loop.html4
-rw-r--r--tests/template/templates/include_loop1.html1
-rw-r--r--tests/template/templates/include_loop2.html1
-rw-r--r--tests/template/templates/include_loop3.html1
-rw-r--r--tests/template/templates/include_variable.html1
7 files changed, 31 insertions, 0 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 44baeaf8f0..28eba05217 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -163,6 +163,27 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
'value',
),
array(
+ 'include_define.html',
+ array('VARIABLE' => 'value'),
+ array(),
+ array(),
+ 'value',
+ ),
+ array(
+ 'include_loop.html',
+ array(),
+ array('loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))),
+ array(),
+ "1\n_1\n_02\n_3",
+ ),
+ array(
+ 'include_variable.html',
+ array('FILE' => 'variable.html', 'VARIABLE' => 'value'),
+ array(),
+ array(),
+ 'value',
+ ),
+ array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
diff --git a/tests/template/templates/include_define.html b/tests/template/templates/include_define.html
new file mode 100644
index 0000000000..2419c8cba1
--- /dev/null
+++ b/tests/template/templates/include_define.html
@@ -0,0 +1,2 @@
+<!-- DEFINE $DEF = 'variable.html' -->
+<!-- INCLUDE {$DEF} -->
diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html
new file mode 100644
index 0000000000..d5c3d9bc82
--- /dev/null
+++ b/tests/template/templates/include_loop.html
@@ -0,0 +1,4 @@
+<!-- BEGIN loop -->
+<!-- INCLUDE {loop.NESTED_FILE} -->
+<!-- BEGIN inner -->_<!-- INCLUDE {inner.NESTED_FILE} --><!-- END inner -->
+<!-- END loop -->
diff --git a/tests/template/templates/include_loop1.html b/tests/template/templates/include_loop1.html
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/template/templates/include_loop1.html
@@ -0,0 +1 @@
+1
diff --git a/tests/template/templates/include_loop2.html b/tests/template/templates/include_loop2.html
new file mode 100644
index 0000000000..9e22bcb8e3
--- /dev/null
+++ b/tests/template/templates/include_loop2.html
@@ -0,0 +1 @@
+02
diff --git a/tests/template/templates/include_loop3.html b/tests/template/templates/include_loop3.html
new file mode 100644
index 0000000000..00750edc07
--- /dev/null
+++ b/tests/template/templates/include_loop3.html
@@ -0,0 +1 @@
+3
diff --git a/tests/template/templates/include_variable.html b/tests/template/templates/include_variable.html
new file mode 100644
index 0000000000..b907e0b44f
--- /dev/null
+++ b/tests/template/templates/include_variable.html
@@ -0,0 +1 @@
+<!-- INCLUDE {FILE} -->