aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-14 08:56:06 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-03-14 08:56:06 +0100
commit954f0697ce5888deb1f08a683df6182dafaf73e4 (patch)
tree42a9de75c739d02ab837ed2b5000f0c79faf77dc
parent36837e1975cafdb171f8512981caaefccd84c76c (diff)
parenta45aa2e5a009747f61b2c7546fbbc64fdd5f6798 (diff)
downloadforums-954f0697ce5888deb1f08a683df6182dafaf73e4.tar
forums-954f0697ce5888deb1f08a683df6182dafaf73e4.tar.gz
forums-954f0697ce5888deb1f08a683df6182dafaf73e4.tar.bz2
forums-954f0697ce5888deb1f08a683df6182dafaf73e4.tar.xz
forums-954f0697ce5888deb1f08a683df6182dafaf73e4.zip
Merge remote-tracking branch 'EXreaction/ticket/10288' into develop
* EXreaction/ticket/10288: [ticket/10288] Test to make sure included templates have proper variable scope
-rw-r--r--tests/template/template_test.php7
-rw-r--r--tests/template/templates/loop_include.html4
-rw-r--r--tests/template/templates/loop_include1.html1
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index aaf55fd15c..2b7be9746e 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -306,6 +306,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(),
"nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
),
+ array(
+ 'loop_include.html',
+ array(),
+ array('test_loop' => array(array('foo' => 'bar'), array('foo' => 'bar1'))),
+ array(),
+ "barbarbar1bar1",
+ ),
/* Does not pass with the current implementation.
array(
'loop_reuse.html',
diff --git a/tests/template/templates/loop_include.html b/tests/template/templates/loop_include.html
new file mode 100644
index 0000000000..7bbdfc4248
--- /dev/null
+++ b/tests/template/templates/loop_include.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+{test_loop.foo}
+ <!-- INCLUDE loop_include1.html -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_include1.html b/tests/template/templates/loop_include1.html
new file mode 100644
index 0000000000..851f6e6e75
--- /dev/null
+++ b/tests/template/templates/loop_include1.html
@@ -0,0 +1 @@
+{test_loop.foo}