diff options
Diffstat (limited to 'apps/files_external/tests/ftp.php')
-rw-r--r-- | apps/files_external/tests/ftp.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php index 8a0821e25a5..3e6208e4a0d 100644 --- a/apps/files_external/tests/ftp.php +++ b/apps/files_external/tests/ftp.php @@ -8,22 +8,21 @@ namespace Test\Files\Storage; -$config=include('apps/files_external/tests/config.php'); -if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']) { - abstract class FTP extends Storage{} - return; -}else{ - class FTP extends Storage { - private $config; +class FTP extends Storage { + private $config; - public function setUp() { - $id=uniqid(); - $this->config=include('apps/files_external/tests/config.php'); - $this->config['ftp']['root'].='/'.$id;//make sure we have an new empty folder to work in - $this->instance=new \OC\Files\Storage\FTP($this->config['ftp']); + public function setUp() { + $id = uniqid(); + $this->config = include('files_external/tests/config.php'); + if (!is_array($this->config) or !isset($this->config['ftp']) or !$this->config['ftp']['run']) { + $this->markTestSkipped('FTP backend not configured'); } + $this->config['ftp']['root'] .= '/' . $id; //make sure we have an new empty folder to work in + $this->instance = new \OC\Files\Storage\FTP($this->config['ftp']); + } - public function tearDown() { + public function tearDown() { + if ($this->instance) { \OCP\Files::rmdirr($this->instance->constructUrl('')); } } |