1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-31 19:49:20 +02:00
php-phpbb/tests/template/subdir/includephp_from_subdir_test.php
Igor Wiedler ae53623230 [feature/template-engine] Refactor $config dependency out of the filter
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
2011-07-10 00:35:07 +02:00

30 lines
1.0 KiB
PHP

<?php
/**
*
* @package testing
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
require_once dirname(__FILE__) . '/../template_test_case.php';
class phpbb_template_subdir_includephp_from_subdir_test extends phpbb_template_template_test_case
{
// Exact copy of test_includephp_relatve from ../includephp_test.php.
// Verifies that relative php inclusion works when including script
// (and thus current working directory) is in a subdirectory of
// board root.
public function test_includephp_relative()
{
$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->template->set_filenames(array('test' => 'includephp_relative.html'));
$this->assertEquals("Path is relative to board root.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
}
}