diff options
Diffstat (limited to 'apps/files_external/tests/backends')
-rw-r--r-- | apps/files_external/tests/backends/amazons3.php | 61 | ||||
-rw-r--r-- | apps/files_external/tests/backends/dropbox.php | 74 | ||||
-rw-r--r-- | apps/files_external/tests/backends/ftp.php | 93 | ||||
-rw-r--r-- | apps/files_external/tests/backends/google.php | 62 | ||||
-rw-r--r-- | apps/files_external/tests/backends/owncloud.php | 58 | ||||
-rw-r--r-- | apps/files_external/tests/backends/sftp.php | 154 | ||||
-rw-r--r-- | apps/files_external/tests/backends/sftp_key.php | 95 | ||||
-rw-r--r-- | apps/files_external/tests/backends/smb.php | 84 | ||||
-rw-r--r-- | apps/files_external/tests/backends/swift.php | 74 | ||||
-rw-r--r-- | apps/files_external/tests/backends/webdav.php | 60 |
10 files changed, 0 insertions, 815 deletions
diff --git a/apps/files_external/tests/backends/amazons3.php b/apps/files_external/tests/backends/amazons3.php deleted file mode 100644 index 3b43f81a926..00000000000 --- a/apps/files_external/tests/backends/amazons3.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Michael Gapczynski <GapczynskiM@gmail.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class AmazonS3 - * - * @group DB - * - * @package Test\Files\Storage - */ -class AmazonS3 extends Storage { - - private $config; - - protected function setUp() { - parent::setUp(); - - $this->config = include('files_external/tests/config.amazons3.php'); - if ( ! is_array($this->config) or ! $this->config['run']) { - $this->markTestSkipped('AmazonS3 backend not configured'); - } - $this->instance = new \OC\Files\Storage\AmazonS3($this->config); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir(''); - } - - parent::tearDown(); - } - - public function testStat() { - $this->markTestSkipped('S3 doesn\'t update the parents folder mtime'); - } -} diff --git a/apps/files_external/tests/backends/dropbox.php b/apps/files_external/tests/backends/dropbox.php deleted file mode 100644 index 1bf8b4171fb..00000000000 --- a/apps/files_external/tests/backends/dropbox.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class Dropbox - * - * @group DB - * - * @package Test\Files\Storage - */ -class Dropbox extends Storage { - private $config; - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['dropbox']) or ! $this->config['dropbox']['run']) { - $this->markTestSkipped('Dropbox backend not configured'); - } - $this->config['dropbox']['root'] .= '/' . $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\Dropbox($this->config['dropbox']); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->unlink('/'); - } - - parent::tearDown(); - } - - public function directoryProvider() { - // doesn't support leading/trailing spaces - return array(array('folder')); - } - - public function testDropboxTouchReturnValue() { - $this->assertFalse($this->instance->file_exists('foo')); - - // true because succeeded - $this->assertTrue($this->instance->touch('foo')); - $this->assertTrue($this->instance->file_exists('foo')); - - // false because not supported - $this->assertFalse($this->instance->touch('foo')); - } -} diff --git a/apps/files_external/tests/backends/ftp.php b/apps/files_external/tests/backends/ftp.php deleted file mode 100644 index 868a022d38f..00000000000 --- a/apps/files_external/tests/backends/ftp.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class FTP - * - * @group DB - * - * @package Test\Files\Storage - */ -class FTP extends Storage { - private $config; - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $this->config = include('files_external/tests/config.ftp.php'); - if ( ! is_array($this->config) or ! $this->config['run']) { - $this->markTestSkipped('FTP backend not configured'); - } - $this->config['root'] .= '/' . $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\FTP($this->config); - $this->instance->mkdir('/'); - } - - protected function tearDown() { - if ($this->instance) { - \OCP\Files::rmdirr($this->instance->constructUrl('')); - } - - parent::tearDown(); - } - - public function testConstructUrl(){ - $config = array ( 'host' => 'localhost', - 'user' => 'ftp', - 'password' => 'ftp', - 'root' => '/', - 'secure' => false ); - $instance = new \OC\Files\Storage\FTP($config); - $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl('')); - - $config['secure'] = true; - $instance = new \OC\Files\Storage\FTP($config); - $this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl('')); - - $config['secure'] = 'false'; - $instance = new \OC\Files\Storage\FTP($config); - $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl('')); - - $config['secure'] = 'true'; - $instance = new \OC\Files\Storage\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')); - } -} diff --git a/apps/files_external/tests/backends/google.php b/apps/files_external/tests/backends/google.php deleted file mode 100644 index 7622f796407..00000000000 --- a/apps/files_external/tests/backends/google.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * @author Bart Visscher <bartv@thisnet.nl> - * @author Christopher Schäpers <kondou@ts.unde.re> - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Michael Gapczynski <GapczynskiM@gmail.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -require_once 'files_external/lib/google.php'; - -/** - * Class Google - * - * @group DB - * - * @package Test\Files\Storage - */ -class Google extends Storage { - - private $config; - - protected function setUp() { - parent::setUp(); - - $this->config = include('files_external/tests/config.php'); - if (!is_array($this->config) || !isset($this->config['google']) - || !$this->config['google']['run'] - ) { - $this->markTestSkipped('Google Drive backend not configured'); - } - $this->instance = new \OC\Files\Storage\Google($this->config['google']); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir('/'); - } - - parent::tearDown(); - } -} diff --git a/apps/files_external/tests/backends/owncloud.php b/apps/files_external/tests/backends/owncloud.php deleted file mode 100644 index a56e9b2a186..00000000000 --- a/apps/files_external/tests/backends/owncloud.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class OwnCloud - * - * @group DB - * - * @package Test\Files\Storage - */ -class OwnCloud extends Storage { - - private $config; - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['owncloud']) or ! $this->config['owncloud']['run']) { - $this->markTestSkipped('ownCloud backend not configured'); - } - $this->config['owncloud']['root'] .= '/' . $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\OwnCloud($this->config['owncloud']); - $this->instance->mkdir('/'); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir('/'); - } - - parent::tearDown(); - } -} diff --git a/apps/files_external/tests/backends/sftp.php b/apps/files_external/tests/backends/sftp.php deleted file mode 100644 index 608982adbc4..00000000000 --- a/apps/files_external/tests/backends/sftp.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php -/** - * @author hkjolhede <hkjolhede@gmail.com> - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class SFTP - * - * @group DB - * - * @package Test\Files\Storage - */ -class SFTP extends Storage { - /** - * @var \OC\Files\Storage\SFTP instance - */ - protected $instance; - - private $config; - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $this->config = include('files_external/tests/config.sftp.php'); - if (!is_array($this->config) or !$this->config['run']) { - $this->markTestSkipped('SFTP backend not configured'); - } - $this->config['root'] .= '/' . $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\SFTP($this->config); - $this->instance->mkdir('/'); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir('/'); - } - - parent::tearDown(); - } - - /** - * @dataProvider configProvider - */ - public function testStorageId($config, $expectedStorageId) { - $instance = new \OC\Files\Storage\SFTP($config); - $this->assertEquals($expectedStorageId, $instance->getId()); - } - - public function configProvider() { - return [ - [ - // no root path - [ - 'run' => true, - 'host' => 'somehost', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => '', - ], - 'sftp::someuser@somehost//', - ], - [ - // without leading nor trailing slash - [ - 'run' => true, - 'host' => 'somehost', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => 'remotedir/subdir', - ], - 'sftp::someuser@somehost//remotedir/subdir/', - ], - [ - // regular path - [ - 'run' => true, - 'host' => 'somehost', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => '/remotedir/subdir/', - ], - 'sftp::someuser@somehost//remotedir/subdir/', - ], - [ - // different port - [ - 'run' => true, - 'host' => 'somehost:8822', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => 'remotedir/subdir/', - ], - 'sftp::someuser@somehost:8822//remotedir/subdir/', - ], - [ - // ipv6 with port - [ - 'run' => true, - 'host' => 'FE80:0000:0000:0000:0202:B3FF:FE1E:8329', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => 'remotedir/subdir/', - ], - 'sftp::someuser@FE80:0000:0000:0000:0202:B3FF:FE1E:8329//remotedir/subdir/', - ], - [ - // ipv6 without port - [ - 'run' => true, - 'host' => 'FE80:0000:0000:0000:0202:B3FF:FE1E:8329:8822', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => 'remotedir/subdir/', - ], - 'sftp::someuser@FE80:0000:0000:0000:0202:B3FF:FE1E:8329:8822//remotedir/subdir/', - ], - [ - // collapsed ipv6 with port - [ - 'run' => true, - 'host' => 'FE80::0202:B3FF:FE1E:8329:8822', - 'user' => 'someuser', - 'password' => 'somepassword', - 'root' => 'remotedir/subdir/', - ], - 'sftp::someuser@FE80::0202:B3FF:FE1E:8329:8822//remotedir/subdir/', - ], - ]; - } -} diff --git a/apps/files_external/tests/backends/sftp_key.php b/apps/files_external/tests/backends/sftp_key.php deleted file mode 100644 index 73c6a0b6432..00000000000 --- a/apps/files_external/tests/backends/sftp_key.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php -/** - * @author Morris Jobke <hey@morrisjobke.de> - * @author Ross Nicoll <jrn@jrn.me.uk> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Viktor Szépe <viktor@szepe.net> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class SFTP_Key - * - * @group DB - * - * @package Test\Files\Storage - */ -class SFTP_Key extends Storage { - private $config; - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['sftp_key']) or ! $this->config['sftp_key']['run']) { - $this->markTestSkipped('SFTP with key backend not configured'); - } - // Make sure we have an new empty folder to work in - $this->config['sftp_key']['root'] .= '/' . $id; - $this->instance = new \OC\Files\Storage\SFTP_Key($this->config['sftp_key']); - $this->instance->mkdir('/'); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir('/'); - } - - parent::tearDown(); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testInvalidAddressShouldThrowException() { - // I'd use example.com for this, but someone decided to break the spec and make it resolve - $this->instance->assertHostAddressValid('notarealaddress...'); - } - - public function testValidAddressShouldPass() { - $this->assertTrue($this->instance->assertHostAddressValid('localhost')); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testNegativePortNumberShouldThrowException() { - $this->instance->assertPortNumberValid('-1'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testNonNumericalPortNumberShouldThrowException() { - $this->instance->assertPortNumberValid('a'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testHighPortNumberShouldThrowException() { - $this->instance->assertPortNumberValid('65536'); - } - - public function testValidPortNumberShouldPass() { - $this->assertTrue($this->instance->assertPortNumberValid('22222')); - } -} diff --git a/apps/files_external/tests/backends/smb.php b/apps/files_external/tests/backends/smb.php deleted file mode 100644 index f9a377c271b..00000000000 --- a/apps/files_external/tests/backends/smb.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class SMB - * - * @group DB - * - * @package Test\Files\Storage - */ -class SMB extends Storage { - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $config = include('files_external/tests/config.smb.php'); - if (!is_array($config) or !$config['run']) { - $this->markTestSkipped('Samba backend not configured'); - } - if (substr($config['root'], -1, 1) != '/') { - $config['root'] .= '/'; - } - $config['root'] .= $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\SMB($config); - $this->instance->mkdir('/'); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir(''); - } - - parent::tearDown(); - } - - public function directoryProvider() { - // doesn't support leading/trailing spaces - return array(array('folder')); - } - - public function testRenameWithSpaces() { - $this->instance->mkdir('with spaces'); - $result = $this->instance->rename('with spaces', 'foo bar'); - $this->assertTrue($result); - $this->assertTrue($this->instance->is_dir('foo bar')); - } - - public function testStorageId() { - $this->instance = new \OC\Files\Storage\SMB([ - 'host' => 'testhost', - 'user' => 'testuser', - 'password' => 'somepass', - 'share' => 'someshare', - 'root' => 'someroot', - ]); - $this->assertEquals('smb::testuser@testhost//someshare//someroot/', $this->instance->getId()); - $this->instance = null; - } -} diff --git a/apps/files_external/tests/backends/swift.php b/apps/files_external/tests/backends/swift.php deleted file mode 100644 index 9bdcd48ee68..00000000000 --- a/apps/files_external/tests/backends/swift.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * @author Christian Berendt <berendt@b1-systems.de> - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class Swift - * - * @group DB - * - * @package Test\Files\Storage - */ -class Swift extends Storage { - - private $config; - - protected function setUp() { - parent::setUp(); - - $this->config = include('files_external/tests/config.swift.php'); - if (!is_array($this->config) or !$this->config['run']) { - $this->markTestSkipped('OpenStack Object Storage backend not configured'); - } - $this->instance = new \OC\Files\Storage\Swift($this->config); - } - - protected function tearDown() { - if ($this->instance) { - try { - $connection = $this->instance->getConnection(); - $container = $connection->getContainer($this->config['bucket']); - - $objects = $container->objectList(); - while($object = $objects->next()) { - $object->setName(str_replace('#','%23',$object->getName())); - $object->delete(); - } - - $container->delete(); - } catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) { - // container didn't exist, so we don't need to delete it - } - } - - parent::tearDown(); - } - - public function testStat() { - $this->markTestSkipped('Swift doesn\'t update the parents folder mtime'); - } -} diff --git a/apps/files_external/tests/backends/webdav.php b/apps/files_external/tests/backends/webdav.php deleted file mode 100644 index e1a710c94b4..00000000000 --- a/apps/files_external/tests/backends/webdav.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace Test\Files\Storage; - -/** - * Class DAV - * - * @group DB - * - * @package Test\Files\Storage - */ -class DAV extends Storage { - - protected function setUp() { - parent::setUp(); - - $id = $this->getUniqueID(); - $config = include('files_external/tests/config.webdav.php'); - if ( ! is_array($config) or !$config['run']) { - $this->markTestSkipped('WebDAV backend not configured'); - } - if (isset($config['wait'])) { - $this->waitDelay = $config['wait']; - } - $config['root'] .= '/' . $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\DAV($config); - $this->instance->mkdir('/'); - } - - protected function tearDown() { - if ($this->instance) { - $this->instance->rmdir('/'); - } - - parent::tearDown(); - } -} |