mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11334] Use mocks instead of making parameters optional
PHPBB3-11334
This commit is contained in:
parent
9259e635ca
commit
076711d9a9
2 changed files with 6 additions and 2 deletions
|
@ -55,7 +55,7 @@ class phpbb_controller_helper
|
||||||
* @param string $phpbb_root_path phpBB root path
|
* @param string $phpbb_root_path phpBB root path
|
||||||
* @param string $php_ext PHP extension
|
* @param string $php_ext PHP extension
|
||||||
*/
|
*/
|
||||||
public function __construct(phpbb_template $template = null, phpbb_user $user = null, $phpbb_root_path = './', $php_ext = '.php')
|
public function __construct(phpbb_template $template, phpbb_user $user, $phpbb_root_path, $php_ext)
|
||||||
{
|
{
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
|
@ -48,7 +48,11 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
|
||||||
global $phpbb_dispatcher;
|
global $phpbb_dispatcher;
|
||||||
|
|
||||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
|
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
|
||||||
$helper = new phpbb_controller_helper;
|
$this->style_resource_locator = new phpbb_style_resource_locator();
|
||||||
|
$this->user = $this->getMock('phpbb_user');
|
||||||
|
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, new phpbb_template_context());
|
||||||
|
|
||||||
|
$helper = new phpbb_controller_helper($this->template, $this->user, '', '.php');
|
||||||
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue