aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template/template_events_test.php
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-06-25 19:22:23 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-06-25 19:22:23 -0500
commit25f0ee9fb61ad1d5c039e1732bec53decb28fe78 (patch)
tree39c55a06e7d578a168b30476e9587dc23831d88b /tests/template/template_events_test.php
parent3766b736da96cfbed3a234235f977f8f56c60632 (diff)
downloadforums-25f0ee9fb61ad1d5c039e1732bec53decb28fe78.tar
forums-25f0ee9fb61ad1d5c039e1732bec53decb28fe78.tar.gz
forums-25f0ee9fb61ad1d5c039e1732bec53decb28fe78.tar.bz2
forums-25f0ee9fb61ad1d5c039e1732bec53decb28fe78.tar.xz
forums-25f0ee9fb61ad1d5c039e1732bec53decb28fe78.zip
[feature/twig] Fixing template events test (and behavior)
According to the test, template event behavior was never correct. Only ONE template event file is supposed to be included from EACH extension. As it was before, EVERY matching template event file from each extension was included (this was how it was designed). E.g. Event call in prosilver "foo" Extension has template "foo" in prosilver AND all foo from all would be included, then foo from prosilver would be included This was clearly not designed correctly as only the most specific event file from each extension should be loaded, otherwise events could only ever be put in a single style tree (either only all, or only prosilver and subsilver2 and any style that inherits from neither of those). Otherwise the events would be duplicated on output (which is clearly not desirable). The Twig behavior already was correct as I designed it, so only the one most specific template event file found would be included from each extension. The tests had to be updated for the correct expected output. PHPBB3-11598
Diffstat (limited to 'tests/template/template_events_test.php')
-rw-r--r--tests/template/template_events_test.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 571e55e04e..07181fcc4d 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -54,11 +54,9 @@ class phpbb_template_template_events_test extends phpbb_template_template_test_c
array(),
array(),
array(),
-'Kappa test event in all
-Omega test event in all
-Zeta test event in all
-Kappa test event in silver
-Omega test event in silver',
+'Kappa test event in silver
+Omega test event in silver
+Zeta test event in all',
),
array(
'Template event with inheritance - child',
@@ -68,10 +66,9 @@ Omega test event in silver',
array(),
array(),
array(),
-'Kappa test event in all
-Omega test event in all
-Zeta test event in all
-Kappa test event in silver_inherit',
+'Kappa test event in silver_inherit
+Omega test event in silver
+Zeta test event in all',
),
array(
'Definition in parent style',
@@ -95,8 +92,7 @@ Kappa test event in silver_inherit',
$this->setup_engine_for_events($dataset, $style_names);
// Run test
- $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.php';
- $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file);
+ $this->run_template($file, $vars, $block_vars, $destroy, $expected);
}
protected function setup_engine_for_events($dataset, $style_names, array $new_config = array())