11 changes: 6 additions & 5 deletions apps/files_external/tests/swift.php
Expand Up @@ -38,14 +38,15 @@ public function setUp() {
public function tearDown() {
if ($this->instance) {
$connection = $this->instance->getConnection();
$container = $connection->Container($this->config['swift']['bucket']);
$container = $connection->getContainer($this->config['swift']['bucket']);

$objects = $container->ObjectList();
while($object = $objects->Next()) {
$object->Delete();
$objects = $container->objectList();
while($object = $objects->next()) {
$object->setName(str_replace('#','%23',$object->getName()));
$object->delete();
}

$container->Delete();
$container->delete();
}
}
}