aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-09-16 01:24:05 +0200
committerNils Adermann <naderman@naderman.de>2013-09-16 01:24:05 +0200
commit21bbb5850349326464204bdb1bea7ecf5a88c10a (patch)
treec2e2ce66583cf94367301fab73e308c9dd8eddb9 /tests/template
parentbb395bbc50df53bf2e005d95d45f34c7c8934ff0 (diff)
parentae6f37d559a71fb115cdb954452ebab5fb8fc69f (diff)
downloadforums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar.gz
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar.bz2
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar.xz
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.zip
Merge remote-tracking branch 'github-phpbb/develop' into ticket/11700
* github-phpbb/develop: (586 commits) [ticket/11735] Display disabled checkbox in subsilver for read notifications [ticket/11735] Display disabled checkbox when notification is already read [ticket/11844] update acp/authentication language var [ticket/11795] Remove PM popup [ticket/11795] Remove outdated comment from forum_fn.js [ticket/11795] Move find user JS to forum_fn [ticket/11795] Replace TWIG with phpBB syntax in ACP [ticket/11795] Move MSN scripts to forum_fn.js [ticket/11795] Use phpBB template syntax instead of TWIG [ticket/11795] Move PM popup JS to forum_fn.js [ticket/11795] Get rid of pagination JS variables [ticket/11795] Get rid of onload_functions [ticket/11795] Use data-reset-on-edit attr to reset elements [ticket/11795] Redo form elements auto-focus [ticket/11811] Remove outline on :focus [ticket/11836] Fix subsilver fatal error [ticket/11837] Replace escaped single quote with utf-8 single quote [ticket/11836] Fix fatal error on unsupported provider for auth link [ticket/11837] Translate UCP_AUTH_LINK_NOT_SUPPORTED [ticket/11809] Ensure code.js is first script included after jQuery ... Conflicts: phpBB/config/services.yml phpBB/develop/create_schema_files.php phpBB/develop/mysql_upgrader.php phpBB/download/file.php phpBB/includes/bbcode.php phpBB/includes/functions_container.php phpBB/install/database_update.php phpBB/install/index.php phpBB/phpbb/controller/helper.php phpBB/phpbb/controller/resolver.php phpBB/phpbb/request/request_interface.php phpBB/phpbb/session.php phpBB/phpbb/style/extension_path_provider.php phpBB/phpbb/style/path_provider.php phpBB/phpbb/style/path_provider_interface.php phpBB/phpbb/style/resource_locator.php phpBB/phpbb/style/style.php phpBB/phpbb/template/locator.php phpBB/phpbb/template/template.php phpBB/phpbb/template/twig/node/includeasset.php phpBB/phpbb/template/twig/node/includecss.php phpBB/phpbb/template/twig/node/includejs.php phpBB/phpbb/template/twig/twig.php tests/controller/helper_url_test.php tests/di/create_container_test.php tests/extension/style_path_provider_test.php tests/notification/notification_test.php tests/session/continue_test.php tests/session/creation_test.php tests/template/template_events_test.php tests/template/template_test_case.php tests/template/template_test_case_with_tree.php tests/test_framework/phpbb_functional_test_case.php
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html1
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html)0
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html3
-rw-r--r--tests/template/includephp_test.php2
-rw-r--r--tests/template/template_events_test.php15
-rw-r--r--tests/template/template_test.php45
-rw-r--r--tests/template/template_test_case.php8
-rw-r--r--tests/template/template_test_case_with_tree.php7
-rw-r--r--tests/template/templates/define.html19
-rw-r--r--tests/template/templates/if.html2
-rw-r--r--tests/template/templates/include_define_variable.html6
-rw-r--r--tests/template/templates/include_loop.html8
-rw-r--r--tests/template/templates/include_loop_define.html6
-rw-r--r--tests/template/templates/loop.html14
-rw-r--r--tests/template/templates/loop_advanced.html20
-rw-r--r--tests/template/templates/loop_size.html10
-rw-r--r--tests/template/templates/loop_vars.html18
26 files changed, 110 insertions, 74 deletions
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
index 3eb906a09e..3eb906a09e 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
index 3b65d80a6d..3b65d80a6d 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
index 26826d59e3..26826d59e3 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
index 003d193dc3..003d193dc3 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
index 6bf06f5457..6bf06f5457 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
index 7f8058f4e4..7f8058f4e4 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
index 5fc7e5ac12..5fc7e5ac12 100644
--- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
index 028f8aa0d1..028f8aa0d1 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html
new file mode 100644
index 0000000000..235e129f85
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html
@@ -0,0 +1 @@
+{event_loop.S_ROW_COUNT}<!-- IF not event_loop.S_LAST_ROW -->|<!-- ENDIF -->
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
index f2c5762ade..f2c5762ade 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
index fe32a1ed3f..fe32a1ed3f 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html
new file mode 100644
index 0000000000..c70d8f86d7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_loop -->
+<!-- END event_loop -->
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index ff7b890d11..a0dd8368cf 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -46,7 +46,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->style->set_custom_style('tests', $cache_dir, array(), '');
+ $this->template->set_custom_style('tests', $cache_dir);
$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 857807bf89..801f0055c8 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -80,6 +80,16 @@ Zeta test event in all',
array(),
'two in silver in omega',
),
+ array(
+ 'EVENT in loop',
+ 'ext_trivial',
+ array('silver'),
+ 'event_loop.html',
+ array(),
+ array('event_loop' => array(array(), array(), array())),
+ array(),
+ 'event_loop0|event_loop1|event_loop2',
+ ),
);
}
@@ -103,13 +113,10 @@ Zeta test event in all',
$config = new \phpbb\config\config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
- $this->style_resource_locator = new \phpbb\style\resource_locator();
$this->extension_manager = new phpbb_mock_filesystem_extension_manager(
dirname(__FILE__) . "/datasets/$dataset/"
);
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context, $this->extension_manager);
- $this->style_provider = new \phpbb\style\path_provider();
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
- $this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
+ $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
}
}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 802f0c19ba..2cca20f4c2 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -64,6 +64,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
),
array(
'if.html',
+ array('S_OTHER_OTHER_VALUE' => true),
+ array(),
+ array(),
+ '|S_OTHER_OTHER_VALUE|!false',
+ ),
+ array(
+ 'if.html',
array('S_VALUE' => false, 'S_OTHER_VALUE' => true),
array(),
array(),
@@ -93,49 +100,49 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop.html',
array(),
- array('loop' => array(array())),
+ array('test_loop' => array(array())),
array(),
"loop\nloop",
),
array(
'loop.html',
array(),
- array('loop' => array(array(), array()), 'loop.block' => array(array())),
+ array('test_loop' => array(array(), array()), 'test_loop.block' => array(array())),
array(),
"loop\nloop\nloop\nloop",
),
array(
'loop.html',
array(),
- array('loop' => array(array(), array()), 'loop.block' => array(array()), 'block' => array(array(), array())),
+ array('test_loop' => array(array(), array()), 'test_loop.block' => array(array()), 'block' => array(array(), array())),
array(),
"loop\nloop\nloop\nloop\nloop#0-block#0\nloop#0-block#1\nloop#1-block#0\nloop#1-block#1",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'))),
+ array('test_loop' => array(array('VARIABLE' => 'x'))),
array(),
"first\n0 - a\nx - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
array(),
"first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
array(),
"first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast\n0 - c\n1 - c\nlast inner",
),
array(
'loop_advanced.html',
array(),
- array('loop' => array(array(), array(), array(), array(), array(), array(), array())),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array())),
array(),
"101234561\nx\n101234561\nx\n101234561\nx\n1234561\nx\n1\nx\n101\nx\n234\nx\n10\nx\n561\nx\n561",
),
@@ -149,14 +156,14 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'define.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('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
array(),
- "xyz\nabc\nabc\nbar\nbar\nabc",
+ "xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|",
),
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('test_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",
),
@@ -200,7 +207,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
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('test_loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'test_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",
),
@@ -221,8 +228,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
- array('loop'),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
+ array('test_loop'),
'',
),
array(
@@ -230,12 +237,12 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array('VARIABLE' => 'variable.html'),
array(),
array(),
- 'variable.html',
+ "variable.html\nvariable.html\nvariable.html",
),
array(
'include_loop_define.html',
array('VARIABLE' => 'value'),
- array('loop' => array(array('NESTED_FILE' => 'variable.html'))),
+ array('test_loop' => array(array('NESTED_FILE' => 'variable.html'))),
array(),
'value',
),
@@ -243,8 +250,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
- array('loop.inner'),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
+ array('test_loop.inner'),
"first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast",
),*/
array(
@@ -295,7 +302,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_size.html',
array(),
- array('loop' => array(array()), 'empty_loop' => array()),
+ array('test_loop' => array(array()), 'empty_loop' => array()),
array(),
"nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
),
@@ -410,7 +417,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->style->set_custom_style('tests', $cache_dir, array(), '');
+ $this->template->set_custom_style('tests', $cache_dir);
$this->run_template('php.html', array(), array(), array(), 'test');
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 97c0728875..7251151ef0 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -11,11 +11,8 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_template_template_test_case extends phpbb_test_case
{
- protected $style;
protected $template;
protected $template_path;
- protected $style_resource_locator;
- protected $style_provider;
protected $user;
protected $test_path = 'tests/template';
@@ -67,11 +64,8 @@ class phpbb_template_template_test_case extends phpbb_test_case
$this->user = new \phpbb\user;
$this->template_path = $this->test_path . '/templates';
- $this->style_resource_locator = new \phpbb\style\resource_locator();
- $this->style_provider = new \phpbb\style\path_provider();
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
- $this->style->set_custom_style('tests', $this->template_path, array(), '');
+ $this->template->set_custom_style('tests', $this->template_path);
}
protected function setUp()
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 9f97e92fd2..461534a49d 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -20,10 +20,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$this->template_path = $this->test_path . '/templates';
$this->parent_template_path = $this->test_path . '/parent_templates';
- $this->style_resource_locator = new \phpbb\style\resource_locator();
- $this->style_provider = new \phpbb\style\path_provider();
- $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
- $this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
+ $this->template = new \phpbb\template\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
+ $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
}
}
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 4e6d0ee793..bc20c02ed1 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -2,8 +2,27 @@
{$VALUE}
<!-- DEFINE $VALUE = 'abc' -->
{$VALUE}
+<!-- IF $VALUE != 'abc' -->
+$VALUE != 'abc'
+<!-- ELSEIF $VALUE == 'abc' -->
+$VALUE == 'abc'
+<!-- ENDIF -->
+<!-- IF ($VALUE == 'abc') -->
+($VALUE == 'abc')
+<!-- ENDIF -->
+<!-- IF !$DOESNT_EXIST -->
+!$DOESNT_EXIST
+<!-- ENDIF -->
+<!-- IF (!$DOESNT_EXIST) -->
+(!$DOESNT_EXIST)
+<!-- ENDIF -->
<!-- INCLUDE define_include.html -->
{$INCLUDED_VALUE}
{$VALUE}
<!-- UNDEFINE $VALUE -->
{$VALUE}
+<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
+{$VALUE}
+<!-- DEFINE $VALUE = '' -->
+[{$VALUE}]
+<!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}|
diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html
index c010aff7fa..f6ab6e575a 100644
--- a/tests/template/templates/if.html
+++ b/tests/template/templates/if.html
@@ -2,6 +2,8 @@
1
<!-- ELSEIF S_OTHER_VALUE -->
2
+<!-- ELSE IF S_OTHER_OTHER_VALUE -->
+|S_OTHER_OTHER_VALUE|
<!-- ELSE -->
03
<!-- ENDIF -->
diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html
index aff9b574c2..6052657c97 100644
--- a/tests/template/templates/include_define_variable.html
+++ b/tests/template/templates/include_define_variable.html
@@ -1,2 +1,8 @@
<!-- DEFINE $DEF = '{VARIABLE}' -->
<!-- INCLUDE {$DEF} -->
+
+<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF_WITH_UNDERSCORES} -->
+
+<!-- DEFINE $DEF123 = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF123} -->
diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html
index d5c3d9bc82..5cad34b363 100644
--- a/tests/template/templates/include_loop.html
+++ b/tests/template/templates/include_loop.html
@@ -1,4 +1,4 @@
-<!-- BEGIN loop -->
-<!-- INCLUDE {loop.NESTED_FILE} -->
-<!-- BEGIN inner -->_<!-- INCLUDE {inner.NESTED_FILE} --><!-- END inner -->
-<!-- END loop -->
+<!-- BEGIN test_loop -->
+<!-- INCLUDE {test_loop.NESTED_FILE} -->
+<!-- BEGIN inner -->_<!-- INCLUDE {test_loop.inner.NESTED_FILE} --><!-- END inner -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/include_loop_define.html b/tests/template/templates/include_loop_define.html
index f539b21396..4bab09422e 100644
--- a/tests/template/templates/include_loop_define.html
+++ b/tests/template/templates/include_loop_define.html
@@ -1,4 +1,4 @@
-<!-- BEGIN loop -->
-<!-- DEFINE $DEF = '{loop.NESTED_FILE}' -->
+<!-- BEGIN test_loop -->
+<!-- DEFINE $DEF = '{test_loop.NESTED_FILE}' -->
<!-- INCLUDE {$DEF} -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop.html b/tests/template/templates/loop.html
index de1a10004d..f541e934df 100644
--- a/tests/template/templates/loop.html
+++ b/tests/template/templates/loop.html
@@ -1,21 +1,21 @@
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
loop
<!-- BEGINELSE -->
noloop
-<!-- END loop -->
+<!-- END test_loop -->
-<!-- IF .loop -->
+<!-- IF .test_loop -->
loop
<!-- ELSE -->
noloop
<!-- ENDIF -->
-<!-- IF .loop == 2 -->
+<!-- IF .test_loop == 2 -->
loop
<!-- ENDIF -->
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
<!-- BEGIN !block -->
-loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
+loop#{test_loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
<!-- END !block -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_advanced.html b/tests/template/templates/loop_advanced.html
index c75fe55f03..1f56686eaa 100644
--- a/tests/template/templates/loop_advanced.html
+++ b/tests/template/templates/loop_advanced.html
@@ -1,19 +1,19 @@
-<!-- BEGIN loop -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(1,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(1,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(2,4) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(2,4) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,-7) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,-7) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(-2,6) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(-2,6) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(-2,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(-2,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
diff --git a/tests/template/templates/loop_size.html b/tests/template/templates/loop_size.html
index 8f581cef10..2b1fcd2dd4 100644
--- a/tests/template/templates/loop_size.html
+++ b/tests/template/templates/loop_size.html
@@ -22,18 +22,18 @@
! empty
<!-- ENDIF -->
-<!-- IF .loop -->
+<!-- IF .test_loop -->
loop
<!-- ENDIF -->
-<!-- IF .loop == 0 -->
+<!-- IF .test_loop == 0 -->
loop = 0
<!-- ENDIF -->
-<!-- IF ! .loop -->
+<!-- IF ! .test_loop -->
! loop
<!-- ENDIF -->
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
in loop
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_vars.html b/tests/template/templates/loop_vars.html
index 7d86d4b7b6..70a3eb2cec 100644
--- a/tests/template/templates/loop_vars.html
+++ b/tests/template/templates/loop_vars.html
@@ -1,13 +1,13 @@
-<!-- BEGIN loop -->
-<!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF -->
-{loop.S_ROW_NUM} - a
-{loop.VARIABLE} - b
-<!-- IF loop.VARIABLE -->set<!-- ENDIF -->
-<!-- IF loop.S_LAST_ROW -->
+<!-- BEGIN test_loop -->
+<!-- IF test_loop.S_FIRST_ROW -->first<!-- ENDIF -->
+{test_loop.S_ROW_NUM} - a
+{test_loop.VARIABLE} - b
+<!-- IF test_loop.VARIABLE -->set<!-- ENDIF -->
+<!-- IF test_loop.S_LAST_ROW -->
last
<!-- ENDIF -->
<!-- BEGIN inner -->
-{inner.S_ROW_NUM} - c
-<!-- IF inner.S_LAST_ROW and inner.S_ROW_COUNT and inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
+{test_loop.inner.S_ROW_NUM} - c
+<!-- IF test_loop.inner.S_LAST_ROW and test_loop.inner.S_ROW_COUNT and test_loop.inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
<!-- END inner -->
-<!-- END loop -->
+<!-- END test_loop -->