mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/twig] Move test_php back to template_test
Was originally moved because I thought that a new test file might mean a new instance and the memory would be cleared, fixing the original problem, but that isn't true and it was fixed another way. PHPBB3-11598
This commit is contained in:
parent
b4947f94ed
commit
6bbe92a8d0
2 changed files with 16 additions and 30 deletions
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package testing
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
||||
require_once dirname(__FILE__) . '/template_test_case.php';
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
|
@ -369,6 +369,22 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
|||
$this->assertEquals($expecting, $this->display('append_var'));
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
public function alter_block_array_data()
|
||||
{
|
||||
return array(
|
||||
|
|
Loading…
Add table
Reference in a new issue