mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/11334] Add a test for the controller helper URL method
PHPBB3-11334
This commit is contained in:
parent
8c512b0d2d
commit
d3e2fae66d
2 changed files with 7 additions and 1 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, phpbb_user $user, $phpbb_root_path, $php_ext)
|
public function __construct(phpbb_template $template = null, phpbb_user $user = null, $phpbb_root_path = './', $php_ext = '.php')
|
||||||
{
|
{
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
|
@ -40,6 +40,12 @@ class phpbb_controller_test extends phpbb_test_case
|
||||||
$this->assertEquals(2, sizeof($routes));
|
$this->assertEquals(2, sizeof($routes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_controller_url_helper()
|
||||||
|
{
|
||||||
|
$helper = new phpbb_controller_helper;
|
||||||
|
$this->assertEquals($helper->url('foo/bar'),'./app.php?controller=foo/bar');
|
||||||
|
}
|
||||||
|
|
||||||
public function test_controller_resolver()
|
public function test_controller_resolver()
|
||||||
{
|
{
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
|
Loading…
Add table
Reference in a new issue