aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/fixtures/ext/foo/bar/controller/controller.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-10 10:48:19 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-03-10 12:35:30 +0100
commite8fdc1545a54e87541efa404265abbd16dc31ead (patch)
tree2b87993674e5c5a116a82e1c1241008da4fc145d /tests/functional/fixtures/ext/foo/bar/controller/controller.php
parentb876c073776a5b11c08e5f71bf12bc06fd5195d8 (diff)
downloadforums-e8fdc1545a54e87541efa404265abbd16dc31ead.tar
forums-e8fdc1545a54e87541efa404265abbd16dc31ead.tar.gz
forums-e8fdc1545a54e87541efa404265abbd16dc31ead.tar.bz2
forums-e8fdc1545a54e87541efa404265abbd16dc31ead.tar.xz
forums-e8fdc1545a54e87541efa404265abbd16dc31ead.zip
[ticket/12261] Add a functional test for redirect after using login_box()
PHPBB3-12261
Diffstat (limited to 'tests/functional/fixtures/ext/foo/bar/controller/controller.php')
-rw-r--r--tests/functional/fixtures/ext/foo/bar/controller/controller.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
index 558b202948..3b365bcfee 100644
--- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php
+++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
@@ -10,13 +10,15 @@ class controller
protected $helper;
protected $path_helper;
protected $config;
+ protected $user;
- public function __construct(\phpbb\controller\helper $helper, \phpbb\path_helper $path_helper, \phpbb\template\template $template, \phpbb\config\config $config, $root_path, $php_ext)
+ public function __construct(\phpbb\controller\helper $helper, \phpbb\path_helper $path_helper, \phpbb\template\template $template, \phpbb\config\config $config, \phpbb\user $user, $root_path, $php_ext)
{
$this->template = $template;
$this->helper = $helper;
$this->path_helper = $path_helper;
$this->config = $config;
+ $this->user = $user;
$this->root_path = $root_path;
$this->php_ext = $php_ext;
}
@@ -43,6 +45,18 @@ class controller
throw new \phpbb\controller\exception('Exception thrown from foo/exception route');
}
+ public function login_redirect()
+ {
+ if (!$this->user->data['is_registered'])
+ {
+ login_box();
+ }
+
+ $this->template->assign_var('A_VARIABLE', 'I am a variable');
+
+ return $this->helper->render('foo_bar_body.html');
+ }
+
public function redirect()
{
$url_root = generate_board_url();