aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/swift.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests/swift.php')
-rw-r--r--apps/files_external/tests/swift.php28
1 files changed, 13 insertions, 15 deletions
diff --git a/apps/files_external/tests/swift.php b/apps/files_external/tests/swift.php
index 98a97f99b5b..4899d44acad 100644
--- a/apps/files_external/tests/swift.php
+++ b/apps/files_external/tests/swift.php
@@ -8,25 +8,23 @@
namespace Test\Files\Storage;
-$config=include('apps/files_external/tests/config.php');
-if(!is_array($config) or !isset($config['swift']) or !$config['swift']['run']) {
- abstract class SWIFT extends Storage{}
- return;
-}else{
- class SWIFT extends Storage {
- private $config;
+class SWIFT extends Storage {
+ private $config;
- public function setUp() {
- $id=uniqid();
- $this->config=include('apps/files_external/tests/config.php');
- $this->config['swift']['root'].='/'.$id;//make sure we have an new empty folder to work in
- $this->instance=new \OC\Files\Storage\SWIFT($this->config['swift']);
+ public function setUp() {
+ $id = uniqid();
+ $this->config = include('files_external/tests/config.php');
+ if (!is_array($this->config) or !isset($this->config['swift']) or !$this->config['swift']['run']) {
+ $this->markTestSkipped('OpenStack SWIFT backend not configured');
}
+ $this->config['swift']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
+ $this->instance = new \OC\Files\Storage\SWIFT($this->config['swift']);
+ }
- public function tearDown() {
- $this->instance->rmdir('');
+ public function tearDown() {
+ if ($this->instance) {
+ $this->instance->rmdir('');
}
-
}
}