diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-28 11:45:26 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-28 11:45:26 +0100 |
commit | 84f3dd15a63fb80f33e61f6056e142b0443329d5 (patch) | |
tree | 0dc95ebc2f0f950fb8688ddc8d2c2177f36bc084 /apps/files_external/tests | |
parent | f23d641b82b0b8f2834983800b3520fcadf6bd71 (diff) | |
download | nextcloud-server-84f3dd15a63fb80f33e61f6056e142b0443329d5.tar.gz nextcloud-server-84f3dd15a63fb80f33e61f6056e142b0443329d5.zip |
Add trailing slash in FTP root path when missing
Fixes #6093
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r-- | apps/files_external/tests/ftp.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php index 94ed5630d91..3037793120a 100644 --- a/apps/files_external/tests/ftp.php +++ b/apps/files_external/tests/ftp.php @@ -48,5 +48,17 @@ class FTP extends Storage { $config['secure'] = 'true'; $instance = new \OC\Files\Storage\FTP($config); $this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl('')); + + $config['root'] = ''; + $instance = new \OC\Files\Storage\FTP($config); + $this->assertEquals('ftps://ftp:ftp@localhost/somefile.txt', $instance->constructUrl('somefile.txt')); + + $config['root'] = '/abc'; + $instance = new \OC\Files\Storage\FTP($config); + $this->assertEquals('ftps://ftp:ftp@localhost/abc/somefile.txt', $instance->constructUrl('somefile.txt')); + + $config['root'] = '/abc/'; + $instance = new \OC\Files\Storage\FTP($config); + $this->assertEquals('ftps://ftp:ftp@localhost/abc/somefile.txt', $instance->constructUrl('somefile.txt')); } } |