aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework/phpbb_test_case_helpers.php
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-06-10 15:11:27 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-07-15 22:05:06 +0200
commitda7fc9e5daf6e72f9b86dbc5e002febb202f516e (patch)
treead741d7ad78d93c4a39953e717ab3b01a1896e80 /tests/test_framework/phpbb_test_case_helpers.php
parentf1df8e2688bb9765833c18d90302a2f918646929 (diff)
downloadforums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar.gz
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar.bz2
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.tar.xz
forums-da7fc9e5daf6e72f9b86dbc5e002febb202f516e.zip
[ticket/13935] Allow more admin-configurable schemes in post links
PHPBB3-13935
Diffstat (limited to 'tests/test_framework/phpbb_test_case_helpers.php')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php30
1 files changed, 24 insertions, 6 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 70bd309653..3eefcdc5e3 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -473,8 +473,30 @@ class phpbb_test_case_helpers
$phpbb_dispatcher = $dispatcher;
}
+ // Set up the a minimum config
+ if ($container->has('config'))
+ {
+ $config = $container->get('config');
+ }
+ else
+ {
+ $config = new \phpbb\config\config(array());
+ }
+ $default_config = array(
+ 'allow_nocensors' => false,
+ 'allowed_schemes_links' => 'http,https,ftp',
+ 'smilies_path' => 'images/smilies',
+ );
+ foreach ($default_config as $config_name => $config_value)
+ {
+ if (!isset($config[$config_name]))
+ {
+ $config[$config_name] = $config_value;
+ }
+ }
+
// Create and register the text_formatter.s9e.factory service
- $factory = new \phpbb\textformatter\s9e\factory($dal, $cache, $dispatcher, $cache_dir, $cache_key_parser, $cache_key_renderer);
+ $factory = new \phpbb\textformatter\s9e\factory($dal, $cache, $dispatcher, $config, $cache_dir, $cache_key_parser, $cache_key_renderer);
$container->set('text_formatter.s9e.factory', $factory);
// Create a user if none was provided, and add the common lang strings
@@ -537,12 +559,8 @@ class phpbb_test_case_helpers
$dispatcher
);
- $config = ($container->has('config'))
- ? $container->get('config')
- : new \phpbb\config\config(array('smilies_path' => 'images/smilies', 'allow_nocensors' => false));
- $auth = ($container->has('auth')) ? $container->get('auth') : new \phpbb\auth\auth;
-
// Calls configured in services.yml
+ $auth = ($container->has('auth')) ? $container->get('auth') : new \phpbb\auth\auth;
$renderer->configure_quote_helper($quote_helper);
$renderer->configure_smilies_path($config, $path_helper);
$renderer->configure_user($user, $config, $auth);