aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/extension_controller_test.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-11-13 12:03:06 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-11-13 16:30:20 +0100
commita0fca0acc24684615d123d71ce696e43ba4e2615 (patch)
tree564bb46bed42f8e537d13f02049ded1bfde2b573 /tests/functional/extension_controller_test.php
parent0aed2816761601ae902159665fdf58932209f772 (diff)
downloadforums-a0fca0acc24684615d123d71ce696e43ba4e2615.tar
forums-a0fca0acc24684615d123d71ce696e43ba4e2615.tar.gz
forums-a0fca0acc24684615d123d71ce696e43ba4e2615.tar.bz2
forums-a0fca0acc24684615d123d71ce696e43ba4e2615.tar.xz
forums-a0fca0acc24684615d123d71ce696e43ba4e2615.zip
[ticket/11997] Add functional test for redirects in controller
PHPBB3-11997
Diffstat (limited to 'tests/functional/extension_controller_test.php')
-rw-r--r--tests/functional/extension_controller_test.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
index 41bd48c204..b280f01638 100644
--- a/tests/functional/extension_controller_test.php
+++ b/tests/functional/extension_controller_test.php
@@ -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');
+ }
}