1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[feature/template-engine] Make INCLUDEPHP relative to board root.

PHPBB3-9726
This commit is contained in:
Oleg Pudeyev
2011-05-12 20:09:41 -04:00
parent d2ac05aa74
commit 94560d7086
5 changed files with 11 additions and 10 deletions

View File

@@ -438,16 +438,16 @@ class phpbb_template_template_test extends phpbb_test_case
$GLOBALS['config']['tpl_allow_php'] = false;
}
public function test_includephp()
public function test_includephp_relative()
{
$GLOBALS['config']['tpl_allow_php'] = true;
$cache_file = $this->template->cachepath . 'includephp.html.php';
$cache_file = $this->template->cachepath . 'includephp_relative.html.php';
$this->run_template('includephp.html', array(), array(), array(), 'testing included php', $cache_file);
$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.html'));
$this->assertEquals('testing included php', $this->display('test'), "Testing INCLUDEPHP");
$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;
}