diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-02-19 22:22:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-19 22:22:55 +0100 |
commit | 980c78048bdfdcb41cd7154c865af68ba091ac27 (patch) | |
tree | 04a524d12efc9f1e51897aee6a4828353fe4ef06 /apps/files_external/tests/Storage/SwiftTest.php | |
parent | 26a741fd362444b2684321322b38219d4b36f104 (diff) | |
parent | 1541af432e2bb2920bea8d3a2149cdd13db072d7 (diff) | |
download | nextcloud-server-980c78048bdfdcb41cd7154c865af68ba091ac27.tar.gz nextcloud-server-980c78048bdfdcb41cd7154c865af68ba091ac27.zip |
Merge pull request #8314 from nextcloud/openstack
update openstack sdk
Diffstat (limited to 'apps/files_external/tests/Storage/SwiftTest.php')
-rw-r--r-- | apps/files_external/tests/Storage/SwiftTest.php | 16 |
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 } } |