summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests')
-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'));
- }
}