diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-09-19 15:21:04 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-09-19 15:21:04 +0200 |
commit | 543d68a7d37c750b629d96961139bb55a1a45a26 (patch) | |
tree | e7c7dd75a141d19402e5f63319d4f41e879f89de | |
parent | 6fd54436ee4568cd2e70d08063a816e3ce1ff4bc (diff) | |
download | forums-543d68a7d37c750b629d96961139bb55a1a45a26.tar forums-543d68a7d37c750b629d96961139bb55a1a45a26.tar.gz forums-543d68a7d37c750b629d96961139bb55a1a45a26.tar.bz2 forums-543d68a7d37c750b629d96961139bb55a1a45a26.tar.xz forums-543d68a7d37c750b629d96961139bb55a1a45a26.zip |
[ticket/13073] Use abstract class for controller helper route tests
PHPBB3-13073
-rw-r--r-- | tests/controller/common_helper_route_test.php (renamed from tests/controller/helper_route_test.php) | 2 | ||||
-rw-r--r-- | tests/controller/helper_route_adm_subdir_test.php | 4 | ||||
-rw-r--r-- | tests/controller/helper_route_adm_test.php | 4 | ||||
-rw-r--r-- | tests/controller/helper_route_root_test.php | 33 | ||||
-rw-r--r-- | tests/controller/helper_route_unclean_path_test.php | 4 |
5 files changed, 40 insertions, 7 deletions
diff --git a/tests/controller/helper_route_test.php b/tests/controller/common_helper_route_test.php index 474230aa1c..7fc046879b 100644 --- a/tests/controller/helper_route_test.php +++ b/tests/controller/common_helper_route_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -class phpbb_controller_helper_route_test extends phpbb_test_case +abstract class phpbb_controller_common_helper_route_test extends phpbb_test_case { protected $root_path; diff --git a/tests/controller/helper_route_adm_subdir_test.php b/tests/controller/helper_route_adm_subdir_test.php index b173794f7a..02ff687be0 100644 --- a/tests/controller/helper_route_adm_subdir_test.php +++ b/tests/controller/helper_route_adm_subdir_test.php @@ -12,9 +12,9 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/helper_route_test.php'; +require_once dirname(__FILE__) . '/common_helper_route_test.php'; -class phpbb_controller_helper_route_adm_subdir_test extends phpbb_controller_helper_route_test +class phpbb_controller_helper_route_adm_subdir_test extends phpbb_controller_common_helper_route_test { protected function get_phpbb_root_path() { diff --git a/tests/controller/helper_route_adm_test.php b/tests/controller/helper_route_adm_test.php index 079f779dbf..76cf4a2872 100644 --- a/tests/controller/helper_route_adm_test.php +++ b/tests/controller/helper_route_adm_test.php @@ -12,9 +12,9 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/helper_route_test.php'; +require_once dirname(__FILE__) . '/common_helper_route_test.php'; -class phpbb_controller_helper_route_adm_test extends phpbb_controller_helper_route_test +class phpbb_controller_helper_route_adm_test extends phpbb_controller_common_helper_route_test { protected function get_phpbb_root_path() { diff --git a/tests/controller/helper_route_root_test.php b/tests/controller/helper_route_root_test.php new file mode 100644 index 0000000000..f3978d3e37 --- /dev/null +++ b/tests/controller/helper_route_root_test.php @@ -0,0 +1,33 @@ +<?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_test.php'; + +class phpbb_controller_helper_route_test extends phpbb_controller_common_helper_route_test +{ + protected function get_phpbb_root_path() + { + return ''; + } + + protected function get_uri() + { + return '/app.php'; + } + + protected function get_script_name() + { + return 'app.php'; + } +} diff --git a/tests/controller/helper_route_unclean_path_test.php b/tests/controller/helper_route_unclean_path_test.php index cede004717..9a4c80937c 100644 --- a/tests/controller/helper_route_unclean_path_test.php +++ b/tests/controller/helper_route_unclean_path_test.php @@ -12,9 +12,9 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/helper_route_test.php'; +require_once dirname(__FILE__) . '/common_helper_route_test.php'; -class phpbb_controller_helper_route_unclean_path_test extends phpbb_controller_helper_route_test +class phpbb_controller_helper_route_unclean_path_test extends phpbb_controller_common_helper_route_test { protected function get_phpbb_root_path() { |