1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/11649] Expose Twig through the container

PHPBB3-11649
This commit is contained in:
Tristan Darricau
2014-08-02 19:09:42 +02:00
parent 56ca276dcf
commit 192b8e2568
9 changed files with 192 additions and 47 deletions

View File

@@ -31,7 +31,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(