aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/controller/common_helper_route.php3
-rw-r--r--tests/extension/metadata_manager_test.php3
-rw-r--r--tests/template/template_allfolder_test.php3
-rw-r--r--tests/template/template_events_test.php3
-rw-r--r--tests/template/template_includecss_test.php3
-rw-r--r--tests/template/template_test_case.php3
-rw-r--r--tests/template/template_test_case_with_tree.php3
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php13
-rw-r--r--tests/test_framework/phpbb_ui_test_case.php13
9 files changed, 29 insertions, 18 deletions
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php
index 9d3d81963b..367c15a667 100644
--- a/tests/controller/common_helper_route.php
+++ b/tests/controller/common_helper_route.php
@@ -111,7 +111,6 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config,
$this->filesystem,
$this->phpbb_path_helper,
- $container,
$cache_path,
null,
$loader,
@@ -123,7 +122,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)));
- $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(
dirname(__FILE__) . '/',
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 53bd3d109b..19b99ee0ce 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -65,7 +65,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->config,
$filesystem,
$phpbb_path_helper,
- $container,
$cache_path,
null,
$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->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
diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php
index 9a0f1f512e..9a0a42fabd 100644
--- a/tests/template/template_allfolder_test.php
+++ b/tests/template/template_allfolder_test.php
@@ -64,7 +64,6 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
$config,
$filesystem,
$path_helper,
- $container,
$cache_path,
$this->extension_manager,
$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);
- $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->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template';
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 54e08652a1..e245c90aee 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -158,7 +158,6 @@ Zeta test event in all',
$config,
$filesystem,
$path_helper,
- $container,
$cache_path,
$this->extension_manager,
$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);
- $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));
}
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));
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index cda0623dcb..e52d3b76dd 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -102,7 +102,6 @@ class phpbb_template_template_test_case extends phpbb_test_case
$config,
$filesystem,
$path_helper,
- $container,
$cache_path,
null,
$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)));
- $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);
}
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index bf5de6b85e..ff35d16120 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -45,7 +45,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$config,
$filesystem,
$this->phpbb_path_helper,
- $container,
$cache_path,
null,
$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)));
- $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));
}
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index d234642898..20b89aba4e 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -384,9 +384,18 @@ class phpbb_functional_test_case extends phpbb_test_case
@unlink($phpbb_root_path . 'cache/install_lock');
}
- global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
+ global $phpbb_container;
$phpbb_container->reset();
- unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
+
+ $blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
+
+ foreach (array_keys($GLOBALS) as $key)
+ {
+ if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
+ {
+ unset($GLOBALS[$key]);
+ }
+ }
}
public function install_ext($extension)
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php
index b5ac3a576b..c8ca2a9003 100644
--- a/tests/test_framework/phpbb_ui_test_case.php
+++ b/tests/test_framework/phpbb_ui_test_case.php
@@ -256,9 +256,18 @@ class phpbb_ui_test_case extends phpbb_test_case
@unlink($phpbb_root_path . 'cache/install_lock');
}
- global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
+ global $phpbb_container;
$phpbb_container->reset();
- unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
+
+ $blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
+
+ foreach (array_keys($GLOBALS) as $key)
+ {
+ if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
+ {
+ unset($GLOBALS[$key]);
+ }
+ }
}
static protected function get_db()