1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[feature/template-engine] Dependency inject locator into template.

PHPBB3-9726
This commit is contained in:
Oleg Pudeyev
2011-08-09 23:28:40 -04:00
parent 66232035aa
commit acb767f14d
6 changed files with 14 additions and 7 deletions

View File

@@ -68,7 +68,8 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t
$this->template_path = dirname(__FILE__) . '/templates';
$this->parent_template_path = dirname(__FILE__) . '/parent_templates';
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user);
$this->template_locator = new phpbb_template_locator();
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator);
$this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path);
}
}

View File

@@ -13,6 +13,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
{
protected $template;
protected $template_path;
protected $template_locator;
// Keep the contents of the cache for debugging?
const PRESERVE_CACHE = true;
@@ -41,7 +42,8 @@ class phpbb_template_template_test_case extends phpbb_test_case
$config = new phpbb_config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . '/templates';
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user);
$this->template_locator = new phpbb_template_locator();
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator);
$this->template->set_custom_template($this->template_path, 'tests');
}