1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/template-engine] Factor template locator out of template class.

Template locator is responsible for maintaining mapping from template
handles to filenames and paths, and provides resolution services
using these mappings.

Template locator is aware of template inheritance and is capable of
checking template file existence on the filesystem.

PHPBB3-9726
This commit is contained in:
Oleg Pudeyev
2011-07-30 17:06:22 -04:00
parent 4126a571ac
commit 05b71ca04e
3 changed files with 285 additions and 120 deletions

View File

@@ -256,7 +256,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->template->set_filenames(array('test' => $filename));
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
$expecting = sprintf('_source_file_for_handle(): File %s does not exist', realpath($this->template_path . '/../') . '/templates/' . $filename);
$expecting = sprintf('template locator: File %s does not exist', realpath($this->template_path . '/../') . '/templates/' . $filename);
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
$this->display('test');
@@ -264,7 +264,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
public function test_empty_file()
{
$expecting = 'template->set_filenames: Empty filename specified for test';
$expecting = 'template locator: set_filenames: Empty filename specified for test';
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
$this->template->set_filenames(array('test' => ''));