aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template
diff options
context:
space:
mode:
authorVjacheslav Trushkin <cyberalien@gmail.com>2013-04-10 09:00:34 +0300
committerVjacheslav Trushkin <cyberalien@gmail.com>2013-04-10 09:00:34 +0300
commit5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a (patch)
tree0ca694311d617b0ae7295e1cd4b4b4f622d32d47 /tests/template
parent29a5db25ec21a8b349195d01bdd0cfea09814653 (diff)
downloadforums-5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a.tar
forums-5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a.tar.gz
forums-5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a.tar.bz2
forums-5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a.tar.xz
forums-5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a.zip
[ticket/11482] Unit tests for advanced DEFINE
Unit tests for advanced DEFINE and ENDDEFINE PHPBB3-11482
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/template_test.php14
-rw-r--r--tests/template/templates/define.html2
-rw-r--r--tests/template/templates/define_advanced.html12
-rw-r--r--tests/template/templates/define_include2.html11
-rw-r--r--tests/template/templates/define_unclosed.html2
5 files changed, 39 insertions, 2 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 56cc7a9de5..a3c0b69123 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -133,6 +133,20 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
"xyz\nabc\nabc\nbar\nbar\nabc",
),
array(
+ 'define_advanced.html',
+ array(),
+ array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
+ array(),
+ "abc\nzxc\ncde\nbcd",
+ ),
+ array(
+ 'define_unclosed.html',
+ array(),
+ array(),
+ array(),
+ "test",
+ ),
+ array(
'expressions.html',
array(),
array(),
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 4459fffbe0..4e6d0ee793 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -7,5 +7,3 @@
{$VALUE}
<!-- UNDEFINE $VALUE -->
{$VALUE}
-<!-- DEFINE $VALUE -->
-
diff --git a/tests/template/templates/define_advanced.html b/tests/template/templates/define_advanced.html
new file mode 100644
index 0000000000..83467a5b4b
--- /dev/null
+++ b/tests/template/templates/define_advanced.html
@@ -0,0 +1,12 @@
+<!-- DEFINE $VALUE -->
+abc
+<!-- ENDDEFINE -->
+{$VALUE}
+<!-- DEFINE $VALUE1 -->
+bcd
+<!-- ENDDEFINE -->
+<!-- DEFINE $VALUE2 -->
+cde
+<!-- ENDDEFINE -->
+<!-- INCLUDE define_include2.html -->
+{$INCLUDED_VALUE3}
diff --git a/tests/template/templates/define_include2.html b/tests/template/templates/define_include2.html
new file mode 100644
index 0000000000..874f3e1852
--- /dev/null
+++ b/tests/template/templates/define_include2.html
@@ -0,0 +1,11 @@
+<!-- DEFINE $INCLUDED_VALUE1 -->
+zxc
+<!-- ENDDEFINE -->
+<!-- DEFINE $INCLUDED_VALUE2 -->
+qwe
+<!-- ENDDEFINE -->
+{$INCLUDED_VALUE1}
+<!-- DEFINE $INCLUDED_VALUE3 -->
+{$VALUE2}
+{$VALUE1}
+<!-- ENDDEFINE -->
diff --git a/tests/template/templates/define_unclosed.html b/tests/template/templates/define_unclosed.html
new file mode 100644
index 0000000000..1c975eab2b
--- /dev/null
+++ b/tests/template/templates/define_unclosed.html
@@ -0,0 +1,2 @@
+<!-- DEFINE $VALUE -->
+test