aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-08-09 17:17:57 +0200
committerNils Adermann <naderman@naderman.de>2014-08-09 17:17:57 +0200
commitf33be87d0333b974c4bac9f5ed23574230db9755 (patch)
treecebfcfd0aa6713e49ab77688fc6b234443363fea /tests/extension
parent73bd77809ed0acfb19b9124f08d5ec044a911299 (diff)
parent827510a4185ae8ef6fbf0d0f2fbeb92bf63ccace (diff)
downloadforums-f33be87d0333b974c4bac9f5ed23574230db9755.tar
forums-f33be87d0333b974c4bac9f5ed23574230db9755.tar.gz
forums-f33be87d0333b974c4bac9f5ed23574230db9755.tar.bz2
forums-f33be87d0333b974c4bac9f5ed23574230db9755.tar.xz
forums-f33be87d0333b974c4bac9f5ed23574230db9755.zip
Merge remote-tracking branch 'github-nicofuma/ticket/11649' into develop
* github-nicofuma/ticket/11649: [ticket/11649] Fix coding style [ticket/11649] Expose Twig through the container
Diffstat (limited to 'tests/extension')
-rw-r--r--tests/extension/metadata_manager_test.php38
1 files changed, 26 insertions, 12 deletions
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 535e4fe0d5..fdb9deda53 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -47,20 +47,35 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->user = new \phpbb\user();
$this->table_prefix = 'phpbb_';
- $this->template = new \phpbb\template\twig\twig(
- new \phpbb\path_helper(
- new \phpbb\symfony_request(
- new phpbb_mock_request()
- ),
- new \phpbb\filesystem(),
- $this->getMock('\phpbb\request\request'),
- $this->phpbb_root_path,
- $this->phpEx
+ $container = new phpbb_mock_container_builder();
+ $cache_path = $this->phpbb_root_path . 'cache/twig';
+ $context = new \phpbb\template\context();
+ $loader = new \phpbb\template\twig\loader('');
+ $phpbb_path_helper =new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $this->phpbb_root_path,
+ $this->phpEx
+ );
+ $twig = new \phpbb\template\twig\environment(
$this->config,
- $this->user,
- new \phpbb\template\context()
+ $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->migrator = new \phpbb\db\migrator(
$this->config,
@@ -73,7 +88,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
array(),
new \phpbb\db\migration\helper()
);
- $container = new phpbb_mock_container_builder();
$container->set('migrator', $this->migrator);
$this->extension_manager = new \phpbb\extension\manager(