1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 17:56:52 +02:00

[ticket/11997] Add functional test for redirects in controller

PHPBB3-11997
This commit is contained in:
Joas Schilling
2013-11-13 12:03:06 +01:00
parent 0aed281676
commit a0fca0acc2
5 changed files with 72 additions and 1 deletions

View File

@@ -109,4 +109,36 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
$this->assert_response_html(404);
$this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
}
/**
* Check the output of a controller using the template system
*/
public function test_redirect()
{
$this->phpbb_extension_manager->enable('foo/bar');
$crawler = self::request('GET', 'app.php/foo/redirect');
$test_redirects = array(
'index.php',
'../index.php',
'tests/index.php',
'../tests/index.php',
'app.php/index',
'index',
'../index',
'app.php/tests/index',
'tests/index',
'../tests/index',
'index',
);
$filesystem = new \phpbb\filesystem();
foreach ($test_redirects as $row_num => $redirect)
{
$this->assertContains($filesystem->clean_path(self::$root_url . $redirect), $crawler->filter('#redirect_' . $row_num)->text());
}
$this->phpbb_extension_manager->purge('foo/bar');
}
}