aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework/phpbb_test_case_helpers.php
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-12-06 15:23:27 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-12-26 14:19:22 +0100
commitf9d8866aee9bca746801ef0360a5ab350d04061d (patch)
tree6b4bc14a9111c818d4dd8c6b6c109ba865491083 /tests/test_framework/phpbb_test_case_helpers.php
parent9a8fb2e1df0d63f46ee0a6e4b64dc8530b8db809 (diff)
downloadforums-f9d8866aee9bca746801ef0360a5ab350d04061d.tar
forums-f9d8866aee9bca746801ef0360a5ab350d04061d.tar.gz
forums-f9d8866aee9bca746801ef0360a5ab350d04061d.tar.bz2
forums-f9d8866aee9bca746801ef0360a5ab350d04061d.tar.xz
forums-f9d8866aee9bca746801ef0360a5ab350d04061d.zip
[ticket/14323] Set up global objects required during testing
PHPBB3-14323
Diffstat (limited to 'tests/test_framework/phpbb_test_case_helpers.php')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index cb77c6829c..aa58b3974b 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -315,7 +315,7 @@ class phpbb_test_case_helpers
public function set_s9e_services(ContainerInterface $container = null, $fixture = null, $styles_path = null)
{
static $first_run;
- global $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request, $user;
+ global $config, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request, $user;
$cache_dir = __DIR__ . '/../tmp/';
@@ -469,18 +469,25 @@ class phpbb_test_case_helpers
}
// Set up the a minimum config
- if ($container->has('config'))
+ if (!isset($config))
{
- $config = $container->get('config');
- }
- else
- {
- $config = new \phpbb\config\config(array());
+ if ($container->has('config'))
+ {
+ $config = $container->get('config');
+ }
+ else
+ {
+ $config = new \phpbb\config\config(array());
+ }
}
$default_config = array(
- 'allow_nocensors' => false,
+ 'allow_nocensors' => false,
'allowed_schemes_links' => 'http,https,ftp',
- 'smilies_path' => 'images/smilies',
+ 'script_path' => '/phpbb',
+ 'server_name' => 'localhost',
+ 'server_port' => 80,
+ 'server_protocol' => 'http://',
+ 'smilies_path' => 'images/smilies',
);
foreach ($default_config as $config_name => $config_value)
{
@@ -519,7 +526,6 @@ class phpbb_test_case_helpers
->will($this->test_case->returnCallback(__CLASS__ . '::format_date'));
$user->date_format = 'Y-m-d H:i:s';
- $user->host = 'localhost';
$user->optionset('viewcensors', true);
$user->optionset('viewflash', true);
$user->optionset('viewimg', true);