summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/ftp.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests/ftp.php')
-rw-r--r--apps/files_external/tests/ftp.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php
index 4549c420410..80288b59114 100644
--- a/apps/files_external/tests/ftp.php
+++ b/apps/files_external/tests/ftp.php
@@ -24,4 +24,22 @@ class Test_Filestorage_FTP extends Test_FileStorage {
OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}
+
+ public function testConstructUrl(){
+ $config = array ( 'host' => 'localhost', 'user' => 'ftp', 'password' => 'ftp', 'root' => '/', 'secure' => false );
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
+
+ $config['secure'] = true;
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
+
+ $config['secure'] = 'false';
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
+
+ $config['secure'] = 'true';
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
+ }
}