diff options
Diffstat (limited to 'tests/template/includephp_test.php')
-rw-r--r-- | tests/template/includephp_test.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php index f1012b6939..ff7b890d11 100644 --- a/tests/template/includephp_test.php +++ b/tests/template/includephp_test.php @@ -15,9 +15,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case { $this->setup_engine(array('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->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php"); $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"); @@ -27,9 +25,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case { $this->setup_engine(array('tpl_allow_php' => true)); - $cache_file = $this->template->cachepath . 'includephp_variables.html.php'; - - $this->run_template('includephp_variables.html', array('TEMPLATES' => 'templates'), array(), array(), "Path includes variables.\ntesting included php", $cache_file); + $this->run_template('includephp_variables.html', array('TEMPLATES' => 'templates'), array(), array(), "Path includes variables.\ntesting included php"); $this->template->set_filenames(array('test' => 'includephp_variables.html')); $this->assertEquals("Path includes variables.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP"); @@ -37,11 +33,13 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case public function test_includephp_absolute() { - $path_to_php = dirname(__FILE__) . '/templates/_dummy_include.php.inc'; + global $phpbb_root_path; + + $path_to_php = str_replace('\\', '/', dirname(__FILE__)) . '/templates/_dummy_include.php.inc'; $this->assertTrue(phpbb_is_absolute($path_to_php)); $template_text = "Path is absolute.\n<!-- INCLUDEPHP $path_to_php -->"; - $cache_dir = dirname($this->template->cachepath) . '/'; + $cache_dir = $phpbb_root_path . 'cache/'; $fp = fopen($cache_dir . 'includephp_absolute.html', 'w'); fputs($fp, $template_text); fclose($fp); @@ -49,9 +47,8 @@ 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(), ''); - $cache_file = $this->template->cachepath . 'includephp_absolute.html.php'; - $this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php", $cache_file); + $this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php"); $this->template->set_filenames(array('test' => 'includephp_absolute.html')); $this->assertEquals("Path is absolute.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP"); |