mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-19 15:01:33 +02:00
[feature/controller] Add controller functional test with template
PHPBB3-10864
This commit is contained in:
@@ -3,6 +3,14 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class phpbb_ext_foo_bar_controller
|
||||
{
|
||||
protected $template;
|
||||
|
||||
public function __construct(phpbb_controller_helper $helper, phpbb_template $template)
|
||||
{
|
||||
$this->template = $template;
|
||||
$this->helper = $helper;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
return new Response('foo/bar controller handle() method', 200);
|
||||
@@ -12,4 +20,11 @@ class phpbb_ext_foo_bar_controller
|
||||
{
|
||||
return new Response('Value of "test" URL argument is: ' . $test);
|
||||
}
|
||||
|
||||
public function template()
|
||||
{
|
||||
$this->template->assign_var('A_VARIABLE', 'I am a variable');
|
||||
|
||||
return $this->helper->render('foo_bar_body.html');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user