aboutsummaryrefslogtreecommitdiffstats
path: root/tests/security
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2014-03-10 20:50:08 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2014-03-10 20:50:08 -0500
commitf7020fb5d1368020cf780deaeba56fee56e3dcfa (patch)
tree66f95cb75cf7c892c9ccebc830a654c3a896086e /tests/security
parent235f7c3721f792e0f732ed086e1118a2f08e37a6 (diff)
parent0119a21862bc433b50fe3914e3bae6f12f61129c (diff)
downloadforums-f7020fb5d1368020cf780deaeba56fee56e3dcfa.tar
forums-f7020fb5d1368020cf780deaeba56fee56e3dcfa.tar.gz
forums-f7020fb5d1368020cf780deaeba56fee56e3dcfa.tar.bz2
forums-f7020fb5d1368020cf780deaeba56fee56e3dcfa.tar.xz
forums-f7020fb5d1368020cf780deaeba56fee56e3dcfa.zip
Merge pull request #2092 from nickvergessen/ticket/12090
[ticket/12090] Pass route name to url() instead of the url itself
Diffstat (limited to 'tests/security')
-rw-r--r--tests/security/redirect_test.php33
1 files changed, 2 insertions, 31 deletions
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index 77dc955c26..e5ff3b1541 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -15,11 +15,8 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
{
protected $path_helper;
- protected $controller_helper;
-
public function provider()
{
- $this->controller_helper = $this->get_controller_helper();
// array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false))
return array(
array('data://x', false, false, 'http://localhost/phpBB'),
@@ -38,8 +35,8 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
array('./../foo/bar', false, false, 'http://localhost/foo/bar'),
array('./../foo/bar', true, false, 'http://localhost/foo/bar'),
array('app.php/', false, false, 'http://localhost/phpBB/app.php/'),
- array($this->controller_helper->url('a'), false, false, 'http://localhost/phpBB/app.php/a'),
- array($this->controller_helper->url(''), false, false, 'http://localhost/phpBB/app.php/'),
+ array('app.php/a', false, false, 'http://localhost/phpBB/app.php/a'),
+ array('app.php/a/b', false, false, 'http://localhost/phpBB/app.php/a/b'),
array('./app.php/', false, false, 'http://localhost/phpBB/app.php/'),
array('foobar', false, false, 'http://localhost/phpBB/foobar'),
array('./foobar', false, false, 'http://localhost/phpBB/foobar'),
@@ -69,31 +66,6 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
return $this->path_helper;
}
- protected function get_controller_helper()
- {
- if (!($this->controller_helper instanceof \phpbb\controller\helper))
- {
- global $phpbb_dispatcher;
-
- $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
- $this->user = $this->getMock('\phpbb\user');
- $phpbb_path_helper = new \phpbb\path_helper(
- new \phpbb\symfony_request(
- new phpbb_mock_request()
- ),
- new \phpbb\filesystem(),
- $phpbb_root_path,
- $phpEx
- );
- $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $config, $this->user, new \phpbb\template\context());
-
- // We don't use mod_rewrite in these tests
- $config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
- $this->controller_helper = new \phpbb\controller\helper($this->template, $this->user, $config, '', 'php');
- }
- return $this->controller_helper;
- }
-
protected function setUp()
{
parent::setUp();
@@ -103,7 +75,6 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
);
$this->path_helper = $this->get_path_helper();
- $this->controller_helper = $this->get_controller_helper();
}
/**