aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/fixtures
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-12-27 17:51:40 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-12-27 17:55:14 +0100
commit68ce16f9b33c5aea8f7f6530dd06eb4661333b0b (patch)
tree4c82920d84c7c9cc493d0376a15713bc7ac4c920 /tests/functional/fixtures
parenta304d99b2b5d0b69548b81b013aa711838ff521d (diff)
downloadforums-68ce16f9b33c5aea8f7f6530dd06eb4661333b0b.tar
forums-68ce16f9b33c5aea8f7f6530dd06eb4661333b0b.tar.gz
forums-68ce16f9b33c5aea8f7f6530dd06eb4661333b0b.tar.bz2
forums-68ce16f9b33c5aea8f7f6530dd06eb4661333b0b.tar.xz
forums-68ce16f9b33c5aea8f7f6530dd06eb4661333b0b.zip
[ticket/11997] Use path_helper in in foo/bar extension for redirect URLs
By using path_helper's clean_url() method, we'll be able to properly check the full URL instead of just parts of the expected URL. PHPBB3-11997
Diffstat (limited to 'tests/functional/fixtures')
-rw-r--r--tests/functional/fixtures/ext/foo/bar/config/services.yml1
-rw-r--r--tests/functional/fixtures/ext/foo/bar/controller/controller.php24
2 files changed, 16 insertions, 9 deletions
diff --git a/tests/functional/fixtures/ext/foo/bar/config/services.yml b/tests/functional/fixtures/ext/foo/bar/config/services.yml
index 13aadf9768..b2730b5c09 100644
--- a/tests/functional/fixtures/ext/foo/bar/config/services.yml
+++ b/tests/functional/fixtures/ext/foo/bar/config/services.yml
@@ -3,6 +3,7 @@ services:
class: foo\bar\controller\controller
arguments:
- @controller.helper
+ - @path_helper
- @template
- %core.root_path%
- %core.php_ext%
diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
index 18ec756d3c..3ba253256a 100644
--- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php
+++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
@@ -8,10 +8,11 @@ class controller
{
protected $template;
- public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template, $root_path, $php_ext)
+ public function __construct(\phpbb\controller\helper $helper, \phpbb\path_helper $path_helper, \phpbb\template\template $template, $root_path, $php_ext)
{
$this->template = $template;
$this->helper = $helper;
+ $this->path_helper = $path_helper;
$this->root_path = $root_path;
$this->php_ext = $php_ext;
}
@@ -40,6 +41,7 @@ class controller
public function redirect()
{
+ $url_root = generate_board_url();
$redirects = array(
array(
append_sid($this->root_path . 'index.' . $this->php_ext),
@@ -47,7 +49,7 @@ class controller
),
array(
append_sid($this->root_path . '../index.' . $this->php_ext),
- 'index.php',
+ '../index.php',
),
array(
append_sid($this->root_path . 'tests/index.' . $this->php_ext),
@@ -55,7 +57,7 @@ class controller
),
array(
append_sid($this->root_path . '../tests/index.' . $this->php_ext),
- 'tests/index.php',
+ '../tests/index.php',
),
array(
$this->helper->url('index'),
@@ -63,11 +65,11 @@ class controller
),
array(
$this->helper->url('../index'),
- 'app.php/index',
+ 'index',
),
array(
$this->helper->url('../../index'),
- 'app.php/index',
+ '../index',
),
array(
$this->helper->url('tests/index'),
@@ -75,15 +77,19 @@ class controller
),
array(
$this->helper->url('../tests/index'),
- 'app.php/tests/index',
+ 'tests/index',
),
array(
$this->helper->url('../../tests/index'),
- 'app.php/tests/index',
+ '../tests/index',
),
array(
$this->helper->url('../tests/../index'),
- 'app.php/tests/index',
+ 'index',
+ ),
+ array(
+ $this->helper->url('tests/../index'),
+ 'app.php/index',
),
);
@@ -94,7 +100,7 @@ class controller
));
$this->template->assign_block_vars('redirects_expected', array(
- 'URL' => $redirect[1],
+ 'URL' => $this->path_helper->clean_url($url_root . '/' . $redirect[1]),
));
}