diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2012-03-07 12:37:53 +0100 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2012-03-07 12:37:53 +0100 |
| commit | 0eb7f18c988e0c2a1e59d8f5a9c1ed4797cb7c2d (patch) | |
| tree | 3faa8d3b0acf6ea3656c3b6c35bbcb86c443a50e | |
| parent | d6a6d63a9eee208fdfafed1441f19076a8f6d2e1 (diff) | |
| parent | 6e5fc53f0d1e456ea1047f061287488504b98f65 (diff) | |
| download | forums-0eb7f18c988e0c2a1e59d8f5a9c1ed4797cb7c2d.tar forums-0eb7f18c988e0c2a1e59d8f5a9c1ed4797cb7c2d.tar.gz forums-0eb7f18c988e0c2a1e59d8f5a9c1ed4797cb7c2d.tar.bz2 forums-0eb7f18c988e0c2a1e59d8f5a9c1ed4797cb7c2d.tar.xz forums-0eb7f18c988e0c2a1e59d8f5a9c1ed4797cb7c2d.zip | |
Merge remote-tracking branch 'p/ticket/10685' into develop
* p/ticket/10685:
[ticket/10685] Refactor template test defaults for php 5.4 compatibility.
| -rw-r--r-- | tests/template/template_inheritance_test.php | 7 | ||||
| -rw-r--r-- | tests/template/template_test_case.php | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php index b637166ba6..6987ae6c73 100644 --- a/tests/template/template_inheritance_test.php +++ b/tests/template/template_inheritance_test.php @@ -62,9 +62,12 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file); } - protected function setup_engine() + protected function setup_engine(array $new_config = array()) { - global $phpbb_root_path, $phpEx, $config, $user; + global $phpbb_root_path, $phpEx, $user; + + $defaults = $this->config_defaults(); + $config = new phpbb_config(array_merge($defaults, $new_config)); $this->template_path = dirname(__FILE__) . '/templates'; $this->parent_template_path = dirname(__FILE__) . '/parent_templates'; diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index a78837516b..5b60785fee 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -46,15 +46,20 @@ class phpbb_template_template_test_case extends phpbb_test_case return str_replace("\n\n", "\n", implode("\n", array_map('trim', explode("\n", trim($result))))); } - protected function setup_engine(array $new_config = array()) + protected function config_defaults() { - global $phpbb_root_path, $phpEx, $user; - $defaults = array( 'load_tplcompile' => true, 'tpl_allow_php' => false, ); + return $defaults; + } + + protected function setup_engine(array $new_config = array()) + { + global $phpbb_root_path, $phpEx, $user; + $defaults = $this->config_defaults(); $config = new phpbb_config(array_merge($defaults, $new_config)); $this->template_path = dirname(__FILE__) . '/templates'; |
