From 5d3f0a9abbfe9678a9b5b480d1bbdfae69384018 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 22 Nov 2014 00:13:13 +0100 Subject: [ticket/13359] Add phpbb\template\twig\environment to template constructor PHPBB3-13359 --- tests/template/template_includecss_test.php | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 49bd9dec8b..a8db74c3f1 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -15,6 +15,12 @@ require_once dirname(__FILE__) . '/template_test_case_with_tree.php'; class phpbb_template_template_includecss_test extends phpbb_template_template_test_case_with_tree { + /** @var \phpbb\path_helper */ + protected $phpbb_path_helper; + + /** @var string */ + protected $parent_template_path; + protected function setup_engine(array $new_config = array()) { global $phpbb_root_path, $phpEx, $user; @@ -34,11 +40,32 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $this->template_path = $this->test_path . '/templates'; $this->parent_template_path = $this->test_path . '/parent_templates'; + $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( + $config, + $this->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( $this->phpbb_path_helper, $config, $user, - new phpbb\template\context(), + $context, + $twig, + $cache_path, + array(new \phpbb\template\twig\extension($context, $this->user)), new phpbb_mock_extension_manager( dirname(__FILE__) . '/', array( @@ -50,6 +77,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te ) ) ); + $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path)); } -- cgit v1.2.1 From f4b42c961f5729b0bbadca8a897410f890228364 Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Tue, 3 Feb 2015 12:41:31 +0100 Subject: [ticket/13139] Fix tests PHPBB3-13139 --- tests/template/template_includecss_test.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index a8db74c3f1..96980e17c6 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -83,13 +83,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te public function template_data() { - $url_base = explode('/', dirname(__FILE__)); - foreach ($url_base as &$dir) - { - $dir = rawurlencode($dir); - } - $url_base = implode('/', $url_base); - return array( /* array( @@ -107,11 +100,11 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te ), array( array('TEST' => 3), - '', + '', ), array( array('TEST' => 4), - '', + '', ), ); } -- cgit v1.2.1 From 4bdef6fd21a5dcab455b0cd1ee2652de606929c3 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Thu, 12 Mar 2015 00:25:00 +0100 Subject: [ticket/13697] Moving filesystem related functions to filesystem service * Moving filesystem service to \phpbb\filesystem namespace * Wraping Symfony's Filesystem component * Moving filesystem related functions from includes/functions.php into \phpbb\filesystem\filesystem Functions moved (and deprecated): - phpbb_chmod - phpbb_is_writable - phpbb_is_absolute - phpbb_own_realpath - phpbb_realpath * Adding interface for filesystem service PHPBB3-13697 --- tests/template/template_includecss_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 96980e17c6..7a73d1f888 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -32,7 +32,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te new \phpbb\symfony_request( new phpbb_mock_request() ), - new \phpbb\filesystem(), + new \phpbb\filesystem\filesystem(), $this->getMock('\phpbb\request\request'), $phpbb_root_path, $phpEx @@ -43,7 +43,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $container = new phpbb_mock_container_builder(); $cache_path = $phpbb_root_path . 'cache/twig'; $context = new \phpbb\template\context(); - $loader = new \phpbb\template\twig\loader(''); + $loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), ''); $twig = new \phpbb\template\twig\environment( $config, $this->phpbb_path_helper, -- cgit v1.2.1 From 51376a43919cba7a5037edb7cc31f18b5950437b Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Mon, 4 May 2015 23:50:16 +0200 Subject: [ticket/13638] Inject $filesystem in \phpbb\template\asset PHPBB3-13638 --- tests/template/template_includecss_test.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 7a73d1f888..8c398d992b 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -28,11 +28,13 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $defaults = $this->config_defaults(); $config = new \phpbb\config\config(array_merge($defaults, $new_config)); + $filesystem = new \phpbb\filesystem\filesystem(); + $this->phpbb_path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( new phpbb_mock_request() ), - new \phpbb\filesystem\filesystem(), + $filesystem, $this->getMock('\phpbb\request\request'), $phpbb_root_path, $phpEx @@ -46,6 +48,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), ''); $twig = new \phpbb\template\twig\environment( $config, + $filesystem, $this->phpbb_path_helper, $container, $cache_path, -- cgit v1.2.1 From 7b301e22f32e9209bb4e3ea17a5637a84a4ef908 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Fri, 1 May 2015 19:04:21 +0200 Subject: [ticket/13804] Make template's user dependency optional PHPBB3-13804 --- tests/template/template_includecss_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 8c398d992b..062fc9493b 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -64,10 +64,10 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $this->template = new phpbb\template\twig\twig( $this->phpbb_path_helper, $config, - $user, $context, $twig, $cache_path, + $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), new phpbb_mock_extension_manager( dirname(__FILE__) . '/', -- cgit v1.2.1 From 80f91da9b9ab7f4c2d66ba5632802a3a5dfa489f Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 8 Jul 2015 15:11:10 -0700 Subject: [ticket/13995] Fix errors in tests from merge conflict PHPBB3-13995 --- tests/template/template_includecss_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index ea851e3568..ac62e820ae 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -103,11 +103,11 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te ), array( array('TEST' => 3), - '', + '', ), array( array('TEST' => 4), - '', + '', ), ); } -- cgit v1.2.1 From 663e3bc64238668ec139b53ccfb2f82a1d306601 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 23 Mar 2016 21:59:40 +0100 Subject: [ticket/13616] Updates direct call to twig environment constructor PHPBB3-13616 --- tests/template/template_includecss_test.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index ac62e820ae..764652c9c2 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -50,7 +50,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $config, $filesystem, $this->phpbb_path_helper, - $container, $cache_path, null, $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)); } -- cgit v1.2.1 From fcc8e155ec309669bebbf6e0370cecfe64c95193 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 16 Apr 2017 20:53:59 +0700 Subject: [ticket/14990] Move dispatcher object to the front of the options array PHPBB3-14990 --- tests/template/template_includecss_test.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 764652c9c2..bc871aa612 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -53,6 +53,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $cache_path, null, $loader, + new \phpbb\event\dispatcher($container), array( 'cache' => false, 'debug' => false, -- cgit v1.2.1 From ad748ec0a7e6ed32064dea885cc3115f1ce4b23d Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Wed, 17 Jan 2018 22:10:53 +0100 Subject: [ticket/15099] Fix tests PHPBB3-15099 --- tests/template/template_includecss_test.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/template/template_includecss_test.php') diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index bc871aa612..4eb30eda1e 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -95,19 +95,19 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te */ array( array('TEST' => 1), - '', + '', ), array( array('TEST' => 2), - '', + '', ), array( array('TEST' => 3), - '', + '', ), array( array('TEST' => 4), - '', + '', ), ); } -- cgit v1.2.1