[ticket/13616] Updates direct call to twig environment constructor

PHPBB3-13616
This commit is contained in:
Tristan Darricau 2016-03-23 21:59:40 +01:00
parent 4070d1e06f
commit 663e3bc642
9 changed files with 7 additions and 16 deletions

View file

@ -154,7 +154,6 @@ class bbcode
$phpbb_container->get('config'), $phpbb_container->get('config'),
$phpbb_container->get('filesystem'), $phpbb_container->get('filesystem'),
$phpbb_container->get('path_helper'), $phpbb_container->get('path_helper'),
$phpbb_container,
$phpbb_container->getParameter('core.cache_dir'), $phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('ext.manager'), $phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader( new \phpbb\template\twig\loader(

View file

@ -639,7 +639,6 @@ class messenger
$phpbb_container->get('config'), $phpbb_container->get('config'),
$phpbb_container->get('filesystem'), $phpbb_container->get('filesystem'),
$phpbb_container->get('path_helper'), $phpbb_container->get('path_helper'),
$phpbb_container,
$phpbb_container->getParameter('core.cache_dir'), $phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('ext.manager'), $phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader( new \phpbb\template\twig\loader(

View file

@ -95,7 +95,6 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config, $this->config,
$this->filesystem, $this->filesystem,
$this->phpbb_path_helper, $this->phpbb_path_helper,
$container,
$cache_path, $cache_path,
null, null,
$loader, $loader,
@ -107,7 +106,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
) )
); );
$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, $this->user)));
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->extension_manager = new phpbb_mock_extension_manager( $this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/', dirname(__FILE__) . '/',

View file

@ -65,7 +65,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->config, $this->config,
$filesystem, $filesystem,
$phpbb_path_helper, $phpbb_path_helper,
$container,
$cache_path, $cache_path,
null, null,
$loader, $loader,
@ -112,7 +111,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->user = new \phpbb\user($lang, '\phpbb\datetime'); $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, $this->user)));
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
} }
// Should fail from missing composer.json // Should fail from missing composer.json

View file

@ -64,7 +64,6 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
$config, $config,
$filesystem, $filesystem,
$path_helper, $path_helper,
$container,
$cache_path, $cache_path,
$this->extension_manager, $this->extension_manager,
$loader, $loader,
@ -76,7 +75,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
) )
); );
$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, $this->user)), $this->extension_manager);
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template_path = $this->test_path . '/templates'; $this->template_path = $this->test_path . '/templates';
$this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template'; $this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template';

View file

@ -158,7 +158,6 @@ Zeta test event in all',
$config, $config,
$filesystem, $filesystem,
$path_helper, $path_helper,
$container,
$cache_path, $cache_path,
$this->extension_manager, $this->extension_manager,
$loader, $loader,
@ -170,7 +169,7 @@ Zeta test event in all',
) )
); );
$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, $this->user)), $this->extension_manager);
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path)); $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
} }

View file

@ -50,7 +50,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
$config, $config,
$filesystem, $filesystem,
$this->phpbb_path_helper, $this->phpbb_path_helper,
$container,
$cache_path, $cache_path,
null, null,
$loader, $loader,
@ -80,7 +79,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
) )
) )
); );
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path)); $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
} }

View file

@ -102,7 +102,6 @@ class phpbb_template_template_test_case extends phpbb_test_case
$config, $config,
$filesystem, $filesystem,
$path_helper, $path_helper,
$container,
$cache_path, $cache_path,
null, null,
$loader, $loader,
@ -114,7 +113,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
) )
); );
$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, $this->user)));
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', $this->template_path); $this->template->set_custom_style('tests', $this->template_path);
} }

View file

@ -45,7 +45,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$config, $config,
$filesystem, $filesystem,
$this->phpbb_path_helper, $this->phpbb_path_helper,
$container,
$cache_path, $cache_path,
null, null,
$loader, $loader,
@ -57,7 +56,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
) )
); );
$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, $this->user)));
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path)); $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
} }
} }