1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13192] Add method for generating valid user page links

PHPBB3-13192
This commit is contained in:
Marc Alexander
2014-10-21 22:16:53 -05:00
parent e43d1781bf
commit 40497ec824
2 changed files with 52 additions and 0 deletions

View File

@@ -421,4 +421,25 @@ class phpbb_path_helper_test extends phpbb_test_case
{
$this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_web_root_path_from_ajax_referer($referer_url, $board_url));
}
public function data_get_valid_user_page()
{
return array(
// array( current page , mod_rewrite setting , expected output )
array('index', true, 'index'),
array('index', false, 'index'),
array('foo/index', true, 'foo/index'),
array('foo/index', false, 'foo/index'),
array('app.php/foo', false, 'app.php/foo'),
array('app.php/foo', true, 'foo'),
);
}
/**
* @dataProvider data_get_valid_user_page
*/
public function test_get_valid_user_page($page, $mod_rewrite, $expected)
{
$this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_valid_user_page($page, $mod_rewrite));
}
}