diff options
Diffstat (limited to 'tests/text_formatter')
-rw-r--r-- | tests/text_formatter/s9e/default_formatting_test.php | 8 | ||||
-rw-r--r-- | tests/text_formatter/s9e/factory_test.php | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php index b5777a42d4..82c2e1f108 100644 --- a/tests/text_formatter/s9e/default_formatting_test.php +++ b/tests/text_formatter/s9e/default_formatting_test.php @@ -236,12 +236,12 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case '<a href="http://www.phpbb.com/community/path/to/long/url/file.ext#section" class="postlink">http://www.phpbb.com/community/path/to/ ... xt#section</a>' ), array( - 'http://localhost/ http://localhost/viewforum.php?f=1', - '<a href="http://localhost/" class="postlink">http://localhost/</a> <a href="http://localhost/viewforum.php?f=1" class="postlink">viewforum.php?f=1</a>' + 'http://localhost/ http://localhost/phpbb/ http://localhost/phpbb/viewforum.php?f=1', + '<a href="http://localhost/" class="postlink">http://localhost/</a> <a href="http://localhost/phpbb/" class="postlink">http://localhost/phpbb/</a> <a href="http://localhost/phpbb/viewforum.php?f=1" class="postlink">viewforum.php?f=1</a>' ), array( - 'http://localhost/viewforum.php?f=1#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', - '<a href="http://localhost/viewforum.php?f=1#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" class="postlink">viewforum.php?f=1#xxxxxxxxxxxxxxxxxxxxx ... xxxxxxxxxx</a>' + 'http://localhost/phpbb/viewforum.php?f=1#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', + '<a href="http://localhost/phpbb/viewforum.php?f=1#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" class="postlink">viewforum.php?f=1#xxxxxxxxxxxxxxxxxxxxx ... xxxxxxxxxx</a>' ), array( '[quote="[url=http://example.org]xxx[/url]"]...[/quote]', 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; |