diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-11-05 16:39:03 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-11-05 16:39:03 +0100 |
commit | 972243d5640c40b1f161e50f31404c71d7c290c0 (patch) | |
tree | 83bb22e6339452d936ebcc5ea9f0429cd851b06a /apps/files_external/tests | |
parent | 5c72d28ffdcb3290e722bd91bef3f5a5f8130f3f (diff) | |
download | nextcloud-server-972243d5640c40b1f161e50f31404c71d7c290c0.tar.gz nextcloud-server-972243d5640c40b1f161e50f31404c71d7c290c0.zip |
support string values ('true' and 'false') for configuring the secure parameter on external storage backends
fixes #78
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r-- | apps/files_external/tests/ftp.php | 18 |
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('')); + } } |