aboutsummaryrefslogtreecommitdiffstats
path: root/tests/email/email_parsing_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/email/email_parsing_test.php')
-rw-r--r--tests/email/email_parsing_test.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php
index 8fdfe3035e..629df9abb6 100644
--- a/tests/email/email_parsing_test.php
+++ b/tests/email/email_parsing_test.php
@@ -19,7 +19,7 @@ class phpbb_email_parsing_test extends phpbb_test_case
/** @var \ReflectionProperty */
protected $reflection_template_property;
- public function setUp()
+ public function setUp(): void
{
global $phpbb_container, $config, $phpbb_root_path, $phpEx, $request, $user;
@@ -67,13 +67,6 @@ class phpbb_email_parsing_test extends phpbb_test_case
$phpbb_container->set('ext.manager', $extension_manager);
$context = new \phpbb\template\context();
- $twig_extension = new \phpbb\template\twig\extension($context, $lang);
- $phpbb_container->set('template.twig.extensions.phpbb', $twig_extension);
-
- $twig_extensions_collection = new \phpbb\di\service_collection($phpbb_container);
- $twig_extensions_collection->add('template.twig.extensions.phpbb');
- $phpbb_container->set('template.twig.extensions.collection', $twig_extensions_collection);
-
$twig = new \phpbb\template\twig\environment(
$config,
$filesystem,
@@ -89,6 +82,13 @@ class phpbb_email_parsing_test extends phpbb_test_case
'autoescape' => false,
)
);
+ $twig_extension = new \phpbb\template\twig\extension($context, $twig, $lang);
+ $phpbb_container->set('template.twig.extensions.phpbb', $twig_extension);
+
+ $twig_extensions_collection = new \phpbb\di\service_collection($phpbb_container);
+ $twig_extensions_collection->add('template.twig.extensions.phpbb');
+ $phpbb_container->set('template.twig.extensions.collection', $twig_extensions_collection);
+
$twig->addExtension($twig_extension);
$phpbb_container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));