aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/extension_controller_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-12-20 18:13:53 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-12-20 18:13:53 +0100
commit15913fdf79b8e41049e3263e5e27e6690effc65e (patch)
tree77fbf52ea27c6018ebf2a06851733c325f3fc557 /tests/functional/extension_controller_test.php
parent47ea6bc9e61c71f6d54df848b6c61ace052d9e2a (diff)
downloadforums-15913fdf79b8e41049e3263e5e27e6690effc65e.tar
forums-15913fdf79b8e41049e3263e5e27e6690effc65e.tar.gz
forums-15913fdf79b8e41049e3263e5e27e6690effc65e.tar.bz2
forums-15913fdf79b8e41049e3263e5e27e6690effc65e.tar.xz
forums-15913fdf79b8e41049e3263e5e27e6690effc65e.zip
[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
Diffstat (limited to 'tests/functional/extension_controller_test.php')
-rw-r--r--tests/functional/extension_controller_test.php27
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
index ab90223c48..5127aa7f47 100644
--- a/tests/functional/extension_controller_test.php
+++ b/tests/functional/extension_controller_test.php
@@ -121,23 +121,18 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
$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',
- 'app.php/index',
- 'app.php/index',
- 'app.php/tests/index',
- 'app.php/tests/index',
- 'app.php/tests/index',
- 'app.php/tests/index',
- );
-
- foreach ($test_redirects as $row_num => $redirect)
+ $nodes = $crawler->filter('div')->extract(array('id'));
+
+ foreach ($nodes as $redirect)
{
- $this->assertContains($filesystem->clean_path(self::$root_url) . $redirect, $crawler->filter('#redirect_' . $row_num)->text());
+ if (strpos($redirect, 'redirect_expected') !== 0)
+ {
+ continue;
+ }
+
+ $row_num = str_replace('redirect_expected_', '', $redirect);
+
+ $this->assertContains($filesystem->clean_path(self::$root_url) . $crawler->filter('#redirect_expected_' . $row_num)->text(), $crawler->filter('#redirect_' . $row_num)->text());
}
$this->phpbb_extension_manager->purge('foo/bar');