diff options
Diffstat (limited to 'tests/controller')
-rw-r--r-- | tests/controller/common_helper_route.php | 7 | ||||
-rw-r--r-- | tests/controller/helper_route_slash_test.php | 43 |
2 files changed, 49 insertions, 1 deletions
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index 91b0cda68d..f1f369cce6 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -47,6 +47,11 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case return '/app.php'; } + protected function get_base_uri() + { + return $this->get_uri(); + } + protected function get_script_name() { return 'app.php'; @@ -62,7 +67,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case $this->request = new phpbb_mock_request(); $this->request->overwrite('SCRIPT_NAME', $this->get_uri(), \phpbb\request\request_interface::SERVER); $this->request->overwrite('SCRIPT_FILENAME', $this->get_script_name(), \phpbb\request\request_interface::SERVER); - $this->request->overwrite('REQUEST_URI', $this->get_uri(), \phpbb\request\request_interface::SERVER); + $this->request->overwrite('REQUEST_URI', $this->get_base_uri(), \phpbb\request\request_interface::SERVER); $this->request->overwrite('SERVER_NAME', 'localhost', \phpbb\request\request_interface::SERVER); $this->request->overwrite('SERVER_PORT', '80', \phpbb\request\request_interface::SERVER); diff --git a/tests/controller/helper_route_slash_test.php b/tests/controller/helper_route_slash_test.php new file mode 100644 index 0000000000..3db5ec19e5 --- /dev/null +++ b/tests/controller/helper_route_slash_test.php @@ -0,0 +1,43 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/common_helper_route.php'; + +class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_helper_route +{ + protected function get_phpbb_root_path() + { + return './../'; + } + + protected function get_uri() + { + return '/phpBB3/app.php'; + } + + protected function get_base_uri() + { + return '/phpBB3/'; + } + + protected function get_script_name() + { + return 'app.php'; + } + + protected function path_to_app() + { + return 'phpBB3/'; + } +} |