aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFrançois-Xavier de Guillebon <fdn2@3ds.com>2018-01-16 12:46:48 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-05-09 21:30:12 +0200
commit40e61e4d1ec3da2ea48efda401b0044f2aff6071 (patch)
treeca1f7990ca15f09d0eb6c76ba60b2551304e94ec /tests
parentff35f65064bebd44837802765937227ab0f59b37 (diff)
downloadforums-40e61e4d1ec3da2ea48efda401b0044f2aff6071.tar
forums-40e61e4d1ec3da2ea48efda401b0044f2aff6071.tar.gz
forums-40e61e4d1ec3da2ea48efda401b0044f2aff6071.tar.bz2
forums-40e61e4d1ec3da2ea48efda401b0044f2aff6071.tar.xz
forums-40e61e4d1ec3da2ea48efda401b0044f2aff6071.zip
[ticket/15508] Remove call to getEnvironment() from parser
PHPBB3-15508
Diffstat (limited to 'tests')
-rw-r--r--tests/controller/common_helper_route.php2
-rw-r--r--tests/email/email_parsing_test.php14
-rw-r--r--tests/extension/metadata_manager_test.php2
-rw-r--r--tests/template/template_allfolder_test.php2
-rw-r--r--tests/template/template_events_test.php2
-rw-r--r--tests/template/template_includecss_test.php2
-rw-r--r--tests/template/template_test_case.php2
-rw-r--r--tests/template/template_test_case_with_tree.php2
8 files changed, 14 insertions, 14 deletions
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php
index dc43204e2d..21a7cfd182 100644
--- a/tests/controller/common_helper_route.php
+++ b/tests/controller/common_helper_route.php
@@ -122,7 +122,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
'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, $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)));
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->extension_manager = new phpbb_mock_extension_manager(
diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php
index 8fdfe3035e..182517a039 100644
--- a/tests/email/email_parsing_test.php
+++ b/tests/email/email_parsing_test.php
@@ -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));
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index bb272b4df3..39b0576df6 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -111,7 +111,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, $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)));
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
}
diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php
index e7e4f21321..a9a8ecc287 100644
--- a/tests/template/template_allfolder_test.php
+++ b/tests/template/template_allfolder_test.php
@@ -75,7 +75,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, $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)), $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 6bd4180e09..9243390937 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -169,7 +169,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, $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)), $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 042c017878..5f9875a556 100644
--- a/tests/template/template_includecss_test.php
+++ b/tests/template/template_includecss_test.php
@@ -68,7 +68,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
$twig,
$cache_path,
$this->user,
- array(new \phpbb\template\twig\extension($context, $this->user)),
+ array(new \phpbb\template\twig\extension($context, $twig, $this->user)),
new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
array(
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 78fa59c956..005d396a0e 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -113,7 +113,7 @@ 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, $this->user)));
+ $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)));
$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 b0c362b8d0..c0238b6f03 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -56,7 +56,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, $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)));
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
}