mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
[ticket/15214] Add fixes for various other tests
Add new dispatch parameter to the template\twig\extension calls PHPBB3-15214
This commit is contained in:
parent
2c1e43a834
commit
c7d16febef
7 changed files with 19 additions and 13 deletions
|
@ -112,7 +112,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, $twig, $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, $phpbb_dispatcher)));
|
||||
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case
|
|||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader($filesystem);
|
||||
$dispatcher = new \phpbb\event\dispatcher($phpbb_container);
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$filesystem,
|
||||
|
@ -81,7 +82,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case
|
|||
$cache_path,
|
||||
null,
|
||||
$loader,
|
||||
new \phpbb\event\dispatcher($phpbb_container),
|
||||
$dispatcher,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
|
@ -97,7 +98,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case
|
|||
$cache_path,
|
||||
$this->user,
|
||||
[
|
||||
new \phpbb\template\twig\extension($context, $twig, $this->lang),
|
||||
new \phpbb\template\twig\extension($context, $twig, $this->lang, $dispatcher),
|
||||
new \phpbb\template\twig\extension\avatar(),
|
||||
new \phpbb\template\twig\extension\config($config),
|
||||
new \phpbb\template\twig\extension\username(),
|
||||
|
|
|
@ -60,6 +60,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
|
|||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), '');
|
||||
$dispatcher = new \phpbb\event\dispatcher($container);
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$filesystem,
|
||||
|
@ -67,7 +68,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
|
|||
$cache_path,
|
||||
$this->extension_manager,
|
||||
$loader,
|
||||
new \phpbb\event\dispatcher($container),
|
||||
$dispatcher,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
|
@ -75,7 +76,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, $twig, $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, $dispatcher)), $this->extension_manager);
|
||||
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||
|
||||
$this->template_path = $this->test_path . '/templates';
|
||||
|
|
|
@ -154,6 +154,7 @@ Zeta test event in all',
|
|||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), '');
|
||||
$dispatcher = new \phpbb\event\dispatcher($container);
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$filesystem,
|
||||
|
@ -161,7 +162,7 @@ Zeta test event in all',
|
|||
$cache_path,
|
||||
$this->extension_manager,
|
||||
$loader,
|
||||
new \phpbb\event\dispatcher($container),
|
||||
$dispatcher,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
|
@ -169,7 +170,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, $twig, $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, $dispatcher)), $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));
|
||||
|
|
|
@ -46,6 +46,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
|
|||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), '');
|
||||
$dispatcher = new \phpbb\event\dispatcher($container);
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$filesystem,
|
||||
|
@ -53,7 +54,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
|
|||
$cache_path,
|
||||
null,
|
||||
$loader,
|
||||
new \phpbb\event\dispatcher($container),
|
||||
$dispatcher,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
|
@ -68,7 +69,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
|
|||
$twig,
|
||||
$cache_path,
|
||||
$this->user,
|
||||
array(new \phpbb\template\twig\extension($context, $twig, $this->user)),
|
||||
array(new \phpbb\template\twig\extension($context, $twig, $this->user, $dispatcher)),
|
||||
new phpbb_mock_extension_manager(
|
||||
__DIR__ . '/',
|
||||
array(
|
||||
|
|
|
@ -98,6 +98,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
|||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), '');
|
||||
$dispatcher = new \phpbb\event\dispatcher($container);
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$filesystem,
|
||||
|
@ -105,7 +106,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
|||
$cache_path,
|
||||
null,
|
||||
$loader,
|
||||
new \phpbb\event\dispatcher($container),
|
||||
$dispatcher,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
|
@ -113,7 +114,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, $twig, $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, $dispatcher)));
|
||||
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||
$this->template->set_custom_style('tests', $this->template_path);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
|
|||
$cache_path = $phpbb_root_path . 'cache/twig';
|
||||
$context = new \phpbb\template\context();
|
||||
$loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), '');
|
||||
$dispatcher = new \phpbb\event\dispatcher($container);
|
||||
$twig = new \phpbb\template\twig\environment(
|
||||
$config,
|
||||
$filesystem,
|
||||
|
@ -48,7 +49,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
|
|||
$cache_path,
|
||||
null,
|
||||
$loader,
|
||||
new \phpbb\event\dispatcher($container),
|
||||
$dispatcher,
|
||||
array(
|
||||
'cache' => false,
|
||||
'debug' => false,
|
||||
|
@ -56,7 +57,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, $twig, $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, $dispatcher)));
|
||||
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue