mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
The template stream filter no longer depends on the $config global. Instead it uses a 'allow_php' param that is passed via stream_bucket_append's last argument. Tests also adjusted. PHPBB3-9726
31 lines
837 B
PHP
31 lines
837 B
PHP
<?php
|
|
/**
|
|
*
|
|
* @package testing
|
|
* @copyright (c) 2011 phpBB Group
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
*
|
|
*/
|
|
|
|
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
|
|
|
class phpbb_template_template_compile_test extends phpbb_test_case
|
|
{
|
|
private $template_compile;
|
|
private $template_path;
|
|
|
|
protected function setUp()
|
|
{
|
|
$this->template_compile = new phpbb_template_compile(false);
|
|
$this->template_path = dirname(__FILE__) . '/templates';
|
|
}
|
|
|
|
public function test_in_phpbb()
|
|
{
|
|
$output = $this->template_compile->compile_file($this->template_path . '/trivial.html');
|
|
$this->assertTrue(strlen($output) > 0);
|
|
$statements = explode(';', $output);
|
|
$first_statement = $statements[0];
|
|
$this->assertTrue(!!preg_match('#if.*defined.*IN_PHPBB.*exit#', $first_statement));
|
|
}
|
|
}
|