diff options
Diffstat (limited to 'tests/functional/fixtures/ext/foo/bar/controller/controller.php')
| -rw-r--r-- | tests/functional/fixtures/ext/foo/bar/controller/controller.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php index 259d548299..ebb259af2f 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -8,10 +8,12 @@ class controller { protected $template; - public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template) + public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template, $root_path, $php_ext) { $this->template = $template; $this->helper = $helper; + $this->root_path = $root_path; + $this->php_ext = $php_ext; } public function handle() @@ -35,4 +37,30 @@ class controller { throw new \phpbb\controller\exception('Exception thrown from foo/exception route'); } + + public function redirect() + { + $redirects = array( + append_sid($this->root_path . 'index.' . $this->php_ext), + append_sid($this->root_path . '../index.' . $this->php_ext), + append_sid($this->root_path . 'tests/index.' . $this->php_ext), + append_sid($this->root_path . '../tests/index.' . $this->php_ext), + $this->helper->url('index'), + $this->helper->url('../index'), + $this->helper->url('../../index'), + $this->helper->url('tests/index'), + $this->helper->url('../tests/index'), + $this->helper->url('../../tests/index'), + $this->helper->url('../tests/../index'), + ); + + foreach ($redirects as $redirect) + { + $this->template->assign_block_vars('redirects', array( + 'URL' => redirect($redirect, true), + )); + } + + return $this->helper->render('redirect_body.html'); + } } |
