mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[feature/template-engine] Moved includephp test to its own file.
PHPBB3-9726
This commit is contained in:
parent
f24d858cff
commit
efda4da19f
3 changed files with 28 additions and 17 deletions
27
tests/template/includephp_test.php
Normal file
27
tests/template/includephp_test.php
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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';
|
require_once dirname(__FILE__) . '/../template_test_case.php';
|
||||||
|
|
||||||
class phpbb_template_subdir_includephp_from_subdir_test extends phpbb_template_template_test_case
|
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
|
// Verifies that relative php inclusion works when including script
|
||||||
// (and thus current working directory) is in a subdirectory of
|
// (and thus current working directory) is in a subdirectory of
|
||||||
// board root.
|
// board root.
|
||||||
|
|
|
@ -339,20 +339,6 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
||||||
$GLOBALS['config']['tpl_allow_php'] = false;
|
$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()
|
public static function alter_block_array_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue