diff options
Diffstat (limited to 'tests/lib/files/objectstore/swift.php')
-rw-r--r-- | tests/lib/files/objectstore/swift.php | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/tests/lib/files/objectstore/swift.php b/tests/lib/files/objectstore/swift.php index 0aaf7d906dd..136d8d18039 100644 --- a/tests/lib/files/objectstore/swift.php +++ b/tests/lib/files/objectstore/swift.php @@ -23,9 +23,11 @@ namespace OCA\ObjectStore\Tests\Unit; use OC\Files\ObjectStore\ObjectStoreStorage; use OC\Files\ObjectStore\Swift as ObjectStoreToTest; -//class Swift extends PHPUnit_Framework_TestCase { class Swift extends \Test\Files\Storage\Storage { + /** + * @var ObjectStoreToTest + */ private $objectStorage; protected function setUp() { @@ -35,9 +37,6 @@ class Swift extends \Test\Files\Storage\Storage { $this->markTestSkipped('objectstore tests are unreliable in some environments'); } - \OC_App::disable('files_sharing'); - \OC_App::disable('files_versions'); - // reset backend \OC_User::clearBackends(); \OC_User::useBackend('database'); @@ -50,28 +49,15 @@ class Swift extends \Test\Files\Storage\Storage { } // main test user - $userName = 'test'; \OC_Util::tearDownFS(); \OC_User::setUserId(''); \OC\Files\Filesystem::tearDown(); \OC_User::setUserId('test'); - $testContainer = 'oc-test-container-'.substr( md5(rand()), 0, 7); - - $params = array( - 'username' => 'facebook100000330192569', - 'password' => 'Dbdj1sXnRSHxIGc4', - 'container' => $testContainer, - 'autocreate' => true, - 'region' => 'RegionOne', //required, trystack defaults to 'RegionOne' - 'url' => 'http://8.21.28.222:5000/v2.0', // The Identity / Keystone endpoint - 'tenantName' => 'facebook100000330192569', // required on trystack - 'serviceName' => 'swift', //trystack uses swift by default, the lib defaults to 'cloudFiles' if omitted - 'user' => \OC_User::getManager()->get($userName) - ); - $this->objectStorage = new ObjectStoreToTest($params); - $params['objectstore'] = $this->objectStorage; - $this->instance = new ObjectStoreStorage($params); + $config = \OC::$server->getConfig()->getSystemValue('objectstore'); + $this->objectStorage = new ObjectStoreToTest($config['arguments']); + $config['objectstore'] = $this->objectStorage; + $this->instance = new ObjectStoreStorage($config); } protected function tearDown() { @@ -81,6 +67,10 @@ class Swift extends \Test\Files\Storage\Storage { $this->objectStorage->deleteContainer(true); $this->instance->getCache()->clear(); + $users = array('test'); + foreach($users as $userName) { + \OC_User::deleteUser($userName); + } parent::tearDown(); } |