aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-12-05 19:48:01 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-12-26 14:19:22 +0100
commit8fe94a19b46c4e33a117c1a040415f2b1c397e7c (patch)
tree97a3279742d78a2cc30cfbf1dfc4d889c7b190d5 /tests/test_framework
parenteb6ceb963ea7b32ef852b53d3da3a7e795291359 (diff)
downloadforums-8fe94a19b46c4e33a117c1a040415f2b1c397e7c.tar
forums-8fe94a19b46c4e33a117c1a040415f2b1c397e7c.tar.gz
forums-8fe94a19b46c4e33a117c1a040415f2b1c397e7c.tar.bz2
forums-8fe94a19b46c4e33a117c1a040415f2b1c397e7c.tar.xz
forums-8fe94a19b46c4e33a117c1a040415f2b1c397e7c.zip
[ticket/14323] Added support for truncating local URLs
PHPBB3-14323
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 0166b11d06..cb77c6829c 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, $user;
+ global $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request, $user;
$cache_dir = __DIR__ . '/../tmp/';
@@ -490,6 +490,12 @@ class phpbb_test_case_helpers
}
}
+ // Create a fake request
+ if (!isset($request))
+ {
+ $request = new phpbb_mock_request;
+ }
+
// Create and register the text_formatter.s9e.factory service
$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);
@@ -513,6 +519,7 @@ 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);