diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 095efd3a69..48566096c6 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -117,7 +117,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case $lang = new \phpbb\language\language($lang_loader); $this->user = new \phpbb\user($lang, '\phpbb\datetime'); - $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user))); + $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user, $phpbb_dispatcher))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); } diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index 5caae111ca..a762c9e026 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -102,6 +102,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $loader = new \phpbb\template\twig\loader([]); $log = new \phpbb\log\dummy(); $assets_bag = new \phpbb\template\assets_bag(); + $dispatcher = new \phpbb\event\dispatcher(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, @@ -110,7 +111,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $cache_path, null, $loader, - new \phpbb\event\dispatcher(), + $dispatcher, [ 'cache' => false, 'debug' => false, @@ -126,7 +127,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $cache_path, $this->user, [ - new \phpbb\template\twig\extension($context, $twig, $this->lang), + new \phpbb\template\twig\extension($context, $twig, $this->lang, $dispatcher), new \phpbb\template\twig\extension\avatar($avatar_helper), new \phpbb\template\twig\extension\config($config), new \phpbb\template\twig\extension\icon($this->user), diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php index a495f8aff8..88f23d4570 100644 --- a/tests/template/template_allfolder_test.php +++ b/tests/template/template_allfolder_test.php @@ -60,6 +60,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); $assets_bag = new \phpbb\template\assets_bag(); + $dispatcher = new \phpbb\event\dispatcher(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, @@ -68,7 +69,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case $cache_path, $this->extension_manager, $loader, - new \phpbb\event\dispatcher(), + $dispatcher, array( 'cache' => false, 'debug' => false, @@ -76,7 +77,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case 'autoescape' => false, ) ); - $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user)), $this->extension_manager); + $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user, $dispatcher)), $this->extension_manager); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template_path = $this->test_path . '/templates'; diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php index a9b1d39451..3f005ae6ec 100644 --- a/tests/template/template_events_test.php +++ b/tests/template/template_events_test.php @@ -154,6 +154,7 @@ Zeta test event in all', $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); $assets_bag = new \phpbb\template\assets_bag(); + $dispatcher = new \phpbb\event\dispatcher(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, @@ -162,7 +163,7 @@ Zeta test event in all', $cache_path, $this->extension_manager, $loader, - new \phpbb\event\dispatcher(), + $dispatcher, array( 'cache' => false, 'debug' => false, @@ -170,7 +171,7 @@ Zeta test event in all', 'autoescape' => false, ) ); - $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user)), $this->extension_manager); + $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user, $dispatcher)), $this->extension_manager); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path)); diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index a11f627c6f..603fa6c08c 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -46,6 +46,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); $assets_bag = new \phpbb\template\assets_bag(); + $dispatcher = new \phpbb\event\dispatcher(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, @@ -54,7 +55,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $cache_path, null, $loader, - new \phpbb\event\dispatcher(), + $dispatcher, array( 'cache' => false, 'debug' => false, @@ -69,7 +70,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $twig, $cache_path, $this->user, - array(new \phpbb\template\twig\extension($context, $twig, $this->user)), + array(new \phpbb\template\twig\extension($context, $twig, $this->user, $dispatcher)), new phpbb_mock_extension_manager( __DIR__ . '/', array( diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 5224e24b71..da9280c6eb 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -97,6 +97,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); $assets_bag = new \phpbb\template\assets_bag(); + $dispatcher = new \phpbb\event\dispatcher(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, @@ -105,7 +106,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $cache_path, null, $loader, - new \phpbb\event\dispatcher(), + $dispatcher, array( 'cache' => false, 'debug' => false, @@ -113,7 +114,8 @@ class phpbb_template_template_test_case extends phpbb_test_case 'autoescape' => false, ) ); - $this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $lang))); + + $this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $lang, $dispatcher))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style('tests', $this->template_path); } diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index 214d3503c8..637a1af04a 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -47,6 +47,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat $loader = new \phpbb\template\twig\loader(''); $log = new \phpbb\log\dummy(); $assets_bag = new \phpbb\template\assets_bag(); + $dispatcher = new \phpbb\event\dispatcher(); $twig = new \phpbb\template\twig\environment( $assets_bag, $config, @@ -55,7 +56,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat $cache_path, null, $loader, - new \phpbb\event\dispatcher(), + $dispatcher, array( 'cache' => false, 'debug' => false, @@ -63,7 +64,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat 'autoescape' => false, ) ); - $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user))); + $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user, $dispatcher))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path)); }