diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-10-21 22:16:53 -0500 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-10-21 22:16:53 -0500 |
commit | 40497ec824344116143bc30b84fe8eb1c1971ebf (patch) | |
tree | af88c6b77c5e9374f95ea67c10f27933107af6ea /tests | |
parent | e43d1781bf17c9265f075dfc0cc38d807fe3b70e (diff) | |
download | forums-40497ec824344116143bc30b84fe8eb1c1971ebf.tar forums-40497ec824344116143bc30b84fe8eb1c1971ebf.tar.gz forums-40497ec824344116143bc30b84fe8eb1c1971ebf.tar.bz2 forums-40497ec824344116143bc30b84fe8eb1c1971ebf.tar.xz forums-40497ec824344116143bc30b84fe8eb1c1971ebf.zip |
[ticket/13192] Add method for generating valid user page links
PHPBB3-13192
Diffstat (limited to 'tests')
-rw-r--r-- | tests/path_helper/path_helper_test.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php index 3832307897..f2c2e0b102 100644 --- a/tests/path_helper/path_helper_test.php +++ b/tests/path_helper/path_helper_test.php @@ -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)); + } } |