aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-08-05 12:59:55 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-08-05 12:59:55 +0200
commitcbe74844b01f72d2007376ceafdf979a6cc94d47 (patch)
tree558cc4463fdd8cf4b67f6a42197e2349560e690e /tests
parente70373a8202e0431a99f80b941e46ae0282a94d4 (diff)
parent88348e1ccc32e8ba731ee079383061792ab01a16 (diff)
downloadforums-cbe74844b01f72d2007376ceafdf979a6cc94d47.tar
forums-cbe74844b01f72d2007376ceafdf979a6cc94d47.tar.gz
forums-cbe74844b01f72d2007376ceafdf979a6cc94d47.tar.bz2
forums-cbe74844b01f72d2007376ceafdf979a6cc94d47.tar.xz
forums-cbe74844b01f72d2007376ceafdf979a6cc94d47.zip
Merge pull request #3698 from s9e/ticket/13935
[ticket/13935] Allow more admin-configurable schemes in post links * s9e/ticket/13935: [ticket/13935] Removed cache invalidation from acp_board [ticket/13935] Removed UI [ticket/13935] Allow more admin-configurable schemes in post links
Diffstat (limited to 'tests')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php30
-rw-r--r--tests/text_formatter/s9e/factory_test.php1
2 files changed, 25 insertions, 6 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index c0f278c130..0166b11d06 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -468,8 +468,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
@@ -532,12 +554,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);
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php
index 8382097544..c8bf595092 100644
--- a/tests/text_formatter/s9e/factory_test.php
+++ b/tests/text_formatter/s9e/factory_test.php
@@ -49,6 +49,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
$dal,
$this->cache,
$this->dispatcher,
+ new \phpbb\config\config(array('allowed_schemes_links' => 'http,https,ftp')),
$this->get_cache_dir(),
'_foo_parser',
'_foo_renderer'