aboutsummaryrefslogtreecommitdiffstats
path: root/tests/path_helper/web_root_path_test.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-01-08 16:17:48 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-01-08 16:17:48 +0100
commit3e84fb76a3639dce2becb7ae620423a5cfdccecb (patch)
treea332a180333cb71e49e11086d7018e199d0e8ec6 /tests/path_helper/web_root_path_test.php
parent821f737560330827ded1fd5eabead6ac23087e24 (diff)
parentf906fb41e9e995c0ea472a8d6594f54df6f208bf (diff)
downloadforums-3e84fb76a3639dce2becb7ae620423a5cfdccecb.tar
forums-3e84fb76a3639dce2becb7ae620423a5cfdccecb.tar.gz
forums-3e84fb76a3639dce2becb7ae620423a5cfdccecb.tar.bz2
forums-3e84fb76a3639dce2becb7ae620423a5cfdccecb.tar.xz
forums-3e84fb76a3639dce2becb7ae620423a5cfdccecb.zip
Merge remote-tracking branch 'Marc/ticket/11997' into develop
* Marc/ticket/11997: (23 commits) [ticket/11997] Use functional test cases that should always work [ticket/11997] Fix redirect tests for mod rewrite [ticket/11997] Add user's page dir to redirect path and fix unit tests for it [ticket/11997] Remove obsolete function get_controller_redirect_url() [ticket/11997] Use path_helper in in foo/bar extension for redirect URLs [ticket/11997] Add remove_web_root_path() in order to prevent incorrect URLs [ticket/11997] Do not check if file or dir we redirect to exist [ticket/11997] Modifiy tests after adding path_helper clean_url method [ticket/11997] Add clean_url() method to path_helper [ticket/11997] Allow redirects to parent folders like previously [ticket/11997] Move expected redirect returns to controller and output to HTML [ticket/11997] Fix tests for path_helper's get_controller_redirect_url() [ticket/11997] Use get_controller_redirect_url() in redirect() function [ticket/11997] Add method for controller redirect URLs to path helper [ticket/11997] Undo changes to phpbb_own_realpath() [ticket/11997] Remove obsolete failover_flag in function redirect() [ticket/11997] Add functional test for redirects in controller [ticket/11997] Fix missing global [ticket/11997] Fix redirects from inside controllers [ticket/11997] Use $phpbb_filesystem->clean_path() for proper redirect paths ...
Diffstat (limited to 'tests/path_helper/web_root_path_test.php')
-rw-r--r--tests/path_helper/web_root_path_test.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/path_helper/web_root_path_test.php b/tests/path_helper/web_root_path_test.php
index 2e1a37e02b..2c22511402 100644
--- a/tests/path_helper/web_root_path_test.php
+++ b/tests/path_helper/web_root_path_test.php
@@ -146,4 +146,27 @@ class phpbb_path_helper_web_root_path_test extends phpbb_test_case
$this->assertEquals($expected, $path_helper->update_web_root_path($input, $symfony_request));
}
+
+ public function clean_url_data()
+ {
+ return array(
+ array('', ''),
+ array('://', '://'),
+ array('http://', 'http://'),
+ array('http://one/two/three', 'http://one/two/three'),
+ array('http://../one/two', 'http://../one/two'),
+ array('http://one/../two/three', 'http://two/three'),
+ array('http://one/two/../three', 'http://one/three'),
+ array('http://one/two/../../three', 'http://three'),
+ array('http://one/two/../../../three', 'http://../three'),
+ );
+ }
+
+ /**
+ * @dataProvider clean_url_data
+ */
+ public function test_clean_url($input, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->clean_url($input));
+ }
}