aboutsummaryrefslogtreecommitdiffstats
path: root/tests/controller/helper_route_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/controller/helper_route_test.php')
-rw-r--r--tests/controller/helper_route_test.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/controller/helper_route_test.php b/tests/controller/helper_route_test.php
index e906e79164..e4ba6a3018 100644
--- a/tests/controller/helper_route_test.php
+++ b/tests/controller/helper_route_test.php
@@ -43,7 +43,28 @@ class phpbb_controller_helper_route_test extends phpbb_test_case
$phpEx
);
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
- $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $this->user, new \phpbb\template\context());
+
+ $container = new phpbb_mock_container_builder();
+ $cache_path = $phpbb_root_path . 'cache/twig';
+ $context = new \phpbb\template\context();
+ $loader = new \phpbb\template\twig\loader('');
+ $twig = new \phpbb\template\twig\environment(
+ $this->config,
+ $phpbb_path_helper,
+ $container,
+ $cache_path,
+ null,
+ $loader,
+ array(
+ 'cache' => false,
+ 'debug' => false,
+ 'auto_reload' => true,
+ 'autoescape' => false,
+ )
+ );
+ $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $this->user, $context, $twig, $cache_path, array(new \phpbb\template\twig\extension($context, $this->user)));
+ $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
array(