aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-05-18 10:57:04 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-05-18 10:57:04 -0400
commitefda4da19fedd0e5bd67835034cfc689b8f5a740 (patch)
treeabc0d0c9e7b61db5a5783edbcab40bbc849a9bff
parentf24d858cff9d98674cdfe2cb44e1f8fe5afb4563 (diff)
downloadforums-efda4da19fedd0e5bd67835034cfc689b8f5a740.tar
forums-efda4da19fedd0e5bd67835034cfc689b8f5a740.tar.gz
forums-efda4da19fedd0e5bd67835034cfc689b8f5a740.tar.bz2
forums-efda4da19fedd0e5bd67835034cfc689b8f5a740.tar.xz
forums-efda4da19fedd0e5bd67835034cfc689b8f5a740.zip
[feature/template-engine] Moved includephp test to its own file.
PHPBB3-9726
-rw-r--r--tests/template/includephp_test.php27
-rw-r--r--tests/template/subdir/includephp_from_subdir_test.php4
-rw-r--r--tests/template/template_test.php14
3 files changed, 28 insertions, 17 deletions
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
new file mode 100644
index 0000000000..6c1cdb0fd6
--- /dev/null
+++ b/tests/template/includephp_test.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case.php';
+
+class phpbb_template_includephp_test extends phpbb_template_template_test_case
+{
+ public function test_includephp_relative()
+ {
+ $GLOBALS['config']['tpl_allow_php'] = true;
+
+ $cache_file = $this->template->cachepath . 'includephp_relative.html.php';
+
+ $this->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php", $cache_file);
+
+ $this->template->set_filenames(array('test' => 'includephp_relative.html'));
+ $this->assertEquals("Path is relative to board root.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
+
+ $GLOBALS['config']['tpl_allow_php'] = false;
+ }
+}
diff --git a/tests/template/subdir/includephp_from_subdir_test.php b/tests/template/subdir/includephp_from_subdir_test.php
index 7bfd852d9e..d6148c7032 100644
--- a/tests/template/subdir/includephp_from_subdir_test.php
+++ b/tests/template/subdir/includephp_from_subdir_test.php
@@ -7,13 +7,11 @@
*
*/
-require_once dirname(__FILE__) . '/../../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../../phpBB/includes/template.php';
require_once dirname(__FILE__) . '/../template_test_case.php';
class phpbb_template_subdir_includephp_from_subdir_test extends phpbb_template_template_test_case
{
- // Exact copy of test_includephp_relatve from ../template_test.php.
+ // Exact copy of test_includephp_relatve from ../includephp_test.php.
// Verifies that relative php inclusion works when including script
// (and thus current working directory) is in a subdirectory of
// board root.
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index ca43e89922..71cf9d38f3 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -339,20 +339,6 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$GLOBALS['config']['tpl_allow_php'] = false;
}
- public function test_includephp_relative()
- {
- $GLOBALS['config']['tpl_allow_php'] = true;
-
- $cache_file = $this->template->cachepath . 'includephp_relative.html.php';
-
- $this->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php", $cache_file);
-
- $this->template->set_filenames(array('test' => 'includephp_relative.html'));
- $this->assertEquals("Path is relative to board root.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
-
- $GLOBALS['config']['tpl_allow_php'] = false;
- }
-
public static function alter_block_array_data()
{
return array(