$config['secure'] = 'true';
$instance = new OC_Filestorage_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'));
}
}