1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/11997] Move expected redirect returns to controller and output to HTML

The controller will now output the expected redirect returns the same way the
redirect returns are output. The extension controller test will compare those
2 outputs.

PHPBB3-11997
This commit is contained in:
Marc Alexander
2013-12-20 18:13:53 +01:00
parent 47ea6bc9e6
commit 15913fdf79
3 changed files with 62 additions and 27 deletions

View File

@@ -41,23 +41,60 @@ class controller
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'),
array(
append_sid($this->root_path . 'index.' . $this->php_ext),
'index.php',
),
array(
append_sid($this->root_path . '../index.' . $this->php_ext),
'index.php',
),
array(
append_sid($this->root_path . 'tests/index.' . $this->php_ext),
'tests/index.php',
),
array(
append_sid($this->root_path . '../tests/index.' . $this->php_ext),
'tests/index.php',
),
array(
$this->helper->url('index'),
'app.php/index',
),
array(
$this->helper->url('../index'),
'app.php/index',
),
array(
$this->helper->url('../../index'),
'app.php/index',
),
array(
$this->helper->url('tests/index'),
'app.php/tests/index',
),
array(
$this->helper->url('../tests/index'),
'app.php/tests/index',
),
array(
$this->helper->url('../../tests/index'),
'app.php/tests/index',
),
array(
$this->helper->url('../tests/../index'),
'app.php/tests/index',
),
);
foreach ($redirects as $redirect)
{
$this->template->assign_block_vars('redirects', array(
'URL' => redirect($redirect, true),
'URL' => redirect($redirect[0], true),
));
$this->template->assign_block_vars('redirects_expected', array(
'URL' => $redirect[1],
));
}