diff options
| author | JoshyPHP <s9e.dev@gmail.com> | 2015-12-06 15:23:27 +0100 |
|---|---|---|
| committer | JoshyPHP <s9e.dev@gmail.com> | 2015-12-26 14:19:22 +0100 |
| commit | f9d8866aee9bca746801ef0360a5ab350d04061d (patch) | |
| tree | 6b4bc14a9111c818d4dd8c6b6c109ba865491083 /tests/text_formatter/s9e/factory_test.php | |
| parent | 9a8fb2e1df0d63f46ee0a6e4b64dc8530b8db809 (diff) | |
| download | forums-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/text_formatter/s9e/factory_test.php')
| -rw-r--r-- | tests/text_formatter/s9e/factory_test.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index c8bf595092..77f27d6547 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -35,7 +35,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case public function get_factory() { - global $phpbb_root_path; + global $config, $phpbb_root_path, $request, $user; $this->cache = new phpbb_mock_cache; $dal = new \phpbb\textformatter\data_access( $this->new_dbal(), @@ -55,6 +55,16 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case '_foo_renderer' ); + // Global objects required by generate_board_url() + $config = new \phpbb\config\config(array( + 'script_path' => '/phpbb', + 'server_name' => 'localhost', + 'server_port' => 80, + 'server_protocol' => 'http://', + )); + $request = new phpbb_mock_request; + $user = new phpbb_mock_user; + return $factory; } @@ -128,14 +138,14 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case public function test_local_url() { global $config, $user, $request; - $config = array( + $config = new \phpbb\config\config(array( 'force_server_vars' => true, 'server_protocol' => 'http://', 'server_name' => 'path', 'server_port' => 80, 'script_path' => '/to', 'cookie_secure' => false - ); + )); $user = new phpbb_mock_user; $request = new phpbb_mock_request; |
