From 12fd385a4cfcbdd4ef3bc2776af713c7a9585152 Mon Sep 17 00:00:00 2001 From: toxyy Date: Sun, 3 Dec 2023 16:52:15 -0500 Subject: [PATCH] [ticket/15214] Test fix for test_helper_url_no_rewrite Add new dispatch parameter to the template\twig\extension call PHPBB3-15214 --- tests/controller/common_helper_route.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index be755593c7..6b01a13144 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -119,6 +119,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_ $cache_path = $phpbb_root_path . 'cache/twig'; $context = new \phpbb\template\context(); $loader = new \phpbb\template\twig\loader($this->filesystem, ''); + $this->dispatcher = new \phpbb\event\dispatcher($container); $twig = new \phpbb\template\twig\environment( $this->config, $this->filesystem, @@ -126,7 +127,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_ $cache_path, null, $loader, - new \phpbb\event\dispatcher($container), + $this->dispatcher, array( 'cache' => false, 'debug' => false, @@ -134,7 +135,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_ 'autoescape' => false, ) ); - $this->template = new phpbb\template\twig\twig($this->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($this->phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user, $this->dispatcher))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->extension_manager = new phpbb_mock_extension_manager(