Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-02-12 17:08:27 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-19 21:41:16 +0300
commit817f2f8f49aec409da832219f43663793e1933a8 (patch)
tree7e4db6141f7974341937e64be8041db2209277ce /apps/files_external/tests/Storage
parent3192efc415ac6d71683994afdd8f510e3480b42f (diff)
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
}
}