aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/Storage
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-02-12 15:08:27 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-19 19:41:16 +0100
commit817f2f8f49aec409da832219f43663793e1933a8 (patch)
tree7e4db6141f7974341937e64be8041db2209277ce /apps/files_external/tests/Storage
parent3192efc415ac6d71683994afdd8f510e3480b42f (diff)
downloadnextcloud-server-817f2f8f49aec409da832219f43663793e1933a8.tar.gz
nextcloud-server-817f2f8f49aec409da832219f43663793e1933a8.zip
adjust swift external storage to new openstack sdk
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/tests/Storage')
-rw-r--r--apps/files_external/tests/Storage/SwiftTest.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/files_external/tests/Storage/SwiftTest.php b/apps/files_external/tests/Storage/SwiftTest.php
index 19f185ed033..fdda8baace8 100644
--- a/apps/files_external/tests/Storage/SwiftTest.php
+++ b/apps/files_external/tests/Storage/SwiftTest.php
@@ -27,6 +27,7 @@
namespace OCA\Files_External\Tests\Storage;
+use GuzzleHttp\Exception\ClientException;
use \OCA\Files_External\Lib\Storage\Swift;
/**
@@ -40,6 +41,11 @@ class SwiftTest extends \Test\Files\Storage\Storage {
private $config;
+ /**
+ * @var Swift instance
+ */
+ protected $instance;
+
protected function setUp() {
parent::setUp();
@@ -53,17 +59,15 @@ class SwiftTest extends \Test\Files\Storage\Storage {
protected function tearDown() {
if ($this->instance) {
try {
- $connection = $this->instance->getConnection();
- $container = $connection->getContainer($this->config['bucket']);
+ $container = $this->instance->getContainer();
- $objects = $container->objectList();
- while($object = $objects->next()) {
- $object->setName(str_replace('#','%23',$object->getName()));
+ $objects = $container->listObjects();
+ foreach ($objects as $object) {
$object->delete();
}
$container->delete();
- } catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {
+ } catch (ClientException $e) {
// container didn't exist, so we don't need to delete it
}
}