aboutsummaryrefslogtreecommitdiffstats
path: root/tests/path_helper
diff options
context:
space:
mode:
authorMaat <maat-pub@mageia.biz>2020-05-08 21:52:11 +0200
committerMaat <maat-pub@mageia.biz>2020-05-08 21:52:11 +0200
commit8ea437e30605e0f66b5220bf904a61d7c1d11ddd (patch)
treee0db2bb4a012d5b06a633160b19f62f4868ecd28 /tests/path_helper
parent36bc1870f21fac04736a1049c1d5b8e127d729f4 (diff)
parent2fdd46b36431ae0f58bb2e78e42553168db9a0ff (diff)
downloadforums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.gz
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.bz2
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.xz
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.zip
Merge remote-tracking branch 'upstream/prep-release-3.2.9'
Diffstat (limited to 'tests/path_helper')
-rw-r--r--tests/path_helper/path_helper_test.php47
1 files changed, 42 insertions, 5 deletions
diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php
index 73f0e6bafc..49dd40fbec 100644
--- a/tests/path_helper/path_helper_test.php
+++ b/tests/path_helper/path_helper_test.php
@@ -21,14 +21,14 @@ class phpbb_path_helper_test extends phpbb_test_case
{
parent::setUp();
- $filesystem = new \phpbb\filesystem();
+ $filesystem = new \phpbb\filesystem\filesystem();
$this->set_phpbb_root_path($filesystem);
$this->path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request(
new phpbb_mock_request()
),
- new \phpbb\filesystem(),
+ new \phpbb\filesystem\filesystem(),
$this->getMock('\phpbb\request\request'),
$this->phpbb_root_path,
'php'
@@ -56,7 +56,7 @@ class phpbb_path_helper_test extends phpbb_test_case
public function basic_update_web_root_path_data()
{
- $filesystem = new \phpbb\filesystem();
+ $filesystem = new \phpbb\filesystem\filesystem();
$this->set_phpbb_root_path($filesystem);
return array(
@@ -90,7 +90,7 @@ class phpbb_path_helper_test extends phpbb_test_case
public function update_web_root_path_data()
{
- $this->set_phpbb_root_path(new \phpbb\filesystem());
+ $this->set_phpbb_root_path(new \phpbb\filesystem\filesystem());
return array(
array(
@@ -135,6 +135,43 @@ class phpbb_path_helper_test extends phpbb_test_case
'/phpbb3-fork/phpBB/app.php',
'./../',
),
+
+ // No correction if the path is already prepend by the web root path
+ array(
+ './../' . $this->phpbb_root_path . 'test.php',
+ '//',
+ null,
+ null,
+ '',
+ ),
+ array(
+ './../' . $this->phpbb_root_path . 'test.php',
+ '//',
+ 'foo/bar.php',
+ 'bar.php',
+ '',
+ ),
+ array(
+ './../../' . $this->phpbb_root_path . 'test.php',
+ '/foo/template',
+ '/phpbb3-fork/phpBB/app.php/foo/template',
+ '/phpbb3-fork/phpBB/app.php',
+ '',
+ ),
+ array(
+ './../' . $this->phpbb_root_path . 'test.php',
+ '/foo/template',
+ '/phpbb3-fork/phpBB/foo/template',
+ '/phpbb3-fork/phpBB/app.php',
+ '',
+ ),
+ array(
+ './../'.$this->phpbb_root_path . 'test.php',
+ '/',
+ '/phpbb3-fork/phpBB/app.php/',
+ '/phpbb3-fork/phpBB/app.php',
+ '',
+ ),
);
}
@@ -158,7 +195,7 @@ class phpbb_path_helper_test extends phpbb_test_case
$path_helper = new \phpbb\path_helper(
$symfony_request,
- new \phpbb\filesystem(),
+ new \phpbb\filesystem\filesystem(),
$this->getMock('\phpbb\request\request'),
$this->phpbb_root_path,
'php'