diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-01 13:17:59 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-01 13:17:59 -0500 |
commit | 3060cbe089fcb99ee3e7d66fe5b0e4bce171a88a (patch) | |
tree | 701745ba268cb8e7c4b22ee9291a5b5221dee41d /tests/template | |
parent | 6f925552a5a9101b3e8083a0bf27b64b3ffd382a (diff) | |
download | forums-3060cbe089fcb99ee3e7d66fe5b0e4bce171a88a.tar forums-3060cbe089fcb99ee3e7d66fe5b0e4bce171a88a.tar.gz forums-3060cbe089fcb99ee3e7d66fe5b0e4bce171a88a.tar.bz2 forums-3060cbe089fcb99ee3e7d66fe5b0e4bce171a88a.tar.xz forums-3060cbe089fcb99ee3e7d66fe5b0e4bce171a88a.zip |
[feature/twig] Fix template/template_php_test.php
Must create a template file in the cache to load as this causes errors
otherwise. The problem was that Twig builds template files into classes,
which are always stored in PHP memory after being loaded. Because of this,
Twig would never recompile a template that was already compiled on the same
page load (so switching enable PHP on/off in two tests would not work).
PHPBB3-11598
Diffstat (limited to 'tests/template')
-rw-r--r-- | tests/template/template_php_test.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/template/template_php_test.php b/tests/template/template_php_test.php index 9b5e855757..fd4174953c 100644 --- a/tests/template/template_php_test.php +++ b/tests/template/template_php_test.php @@ -14,8 +14,17 @@ class phpbb_template_template_php_test extends phpbb_template_template_test_case { public function test_php() { + $template_text = '<!-- PHP -->echo "test";<!-- ENDPHP -->'; + + $cache_dir = dirname($this->template->cachepath) . '/'; + $fp = fopen($cache_dir . 'php.html', 'w'); + fputs($fp, $template_text); + fclose($fp); + $this->setup_engine(array('tpl_allow_php' => true)); + $this->style->set_custom_style('tests', $cache_dir, array(), ''); + $this->run_template('php.html', array(), array(), array(), 'test'); } -}
\ No newline at end of file +} |