Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-05-27 23:18:59 +0300
committerRobin Appelman <robin@icewind.nl>2021-10-07 18:19:23 +0300
commitccb24416ac9032e745303a725001dab5f89b98b1 (patch)
tree62e383af71aaeaa4529cb446762c06d95a11d1af /apps/files_external/tests/Storage
parent10b613810f533fbba18f9f4301349f86a528535b (diff)
add new ftp backend
this uses the raw `ftp_` functions instead of the stream wrapper Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/tests/Storage')
-rw-r--r--apps/files_external/tests/Storage/FtpTest.php39
1 files changed, 2 insertions, 37 deletions
diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php
index 501c0f72b8d..3a8f94fb7fe 100644
--- a/apps/files_external/tests/Storage/FtpTest.php
+++ b/apps/files_external/tests/Storage/FtpTest.php
@@ -48,12 +48,11 @@ class FtpTest extends \Test\Files\Storage\Storage {
if (! is_array($this->config) or ! $this->config['run']) {
$this->markTestSkipped('FTP backend not configured');
}
- $rootInstace = new FTP($this->config);
- $rootInstace->mkdir($id);
+ $rootInstance = new FTP($this->config);
+ $rootInstance->mkdir($id);
$this->config['root'] .= '/' . $id; //make sure we have an new empty folder to work in
$this->instance = new FTP($this->config);
- $this->instance->mkdir('/');
}
protected function tearDown(): void {
@@ -63,38 +62,4 @@ class FtpTest extends \Test\Files\Storage\Storage {
parent::tearDown();
}
-
- public function testConstructUrl() {
- $config = [ 'host' => 'localhost',
- 'user' => 'ftp',
- 'password' => 'ftp',
- 'root' => '/',
- 'secure' => false ];
- $instance = new FTP($config);
- $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
-
- $config['secure'] = true;
- $instance = new FTP($config);
- $this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
-
- $config['secure'] = 'false';
- $instance = new FTP($config);
- $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
-
- $config['secure'] = 'true';
- $instance = new FTP($config);
- $this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
-
- $config['root'] = '';
- $instance = new FTP($config);
- $this->assertEquals('ftps://ftp:ftp@localhost/somefile.txt', $instance->constructUrl('somefile.txt'));
-
- $config['root'] = '/abc';
- $instance = new FTP($config);
- $this->assertEquals('ftps://ftp:ftp@localhost/abc/somefile.txt', $instance->constructUrl('somefile.txt'));
-
- $config['root'] = '/abc/';
- $instance = new FTP($config);
- $this->assertEquals('ftps://ftp:ftp@localhost/abc/somefile.txt', $instance->constructUrl('somefile.txt'));
- }
}