diff options
Diffstat (limited to 'tests/lib/Files/ObjectStore')
-rw-r--r-- | tests/lib/Files/ObjectStore/AzureTest.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php | 13 | ||||
-rw-r--r-- | tests/lib/Files/ObjectStore/S3Test.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/ObjectStore/SwiftTest.php | 4 |
4 files changed, 16 insertions, 9 deletions
diff --git a/tests/lib/Files/ObjectStore/AzureTest.php b/tests/lib/Files/ObjectStore/AzureTest.php index 1103b15ecd2..3c07f69f65d 100644 --- a/tests/lib/Files/ObjectStore/AzureTest.php +++ b/tests/lib/Files/ObjectStore/AzureTest.php @@ -7,13 +7,15 @@ namespace Test\Files\ObjectStore; use OC\Files\ObjectStore\Azure; +use OCP\IConfig; +use OCP\Server; /** * @group PRIMARY-azure */ class AzureTest extends ObjectStoreTestCase { protected function getInstance() { - $config = \OC::$server->getConfig()->getSystemValue('objectstore'); + $config = Server::get(IConfig::class)->getSystemValue('objectstore'); if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\Azure') { $this->markTestSkipped('objectstore not configured for azure'); } diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php index 508f328fae2..cca75d4f35e 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php @@ -10,6 +10,7 @@ namespace Test\Files\ObjectStore; use OC\Files\ObjectStore\StorageObjectStore; use OC\Files\Storage\Temporary; use OC\Files\Storage\Wrapper\Jail; +use OCP\Constants; use OCP\Files\ObjectStore\IObjectStore; use Test\Files\Storage\Storage; @@ -231,13 +232,13 @@ class ObjectStoreStorageTest extends Storage { $this->instance->file_put_contents('test.txt', 'foo'); $this->assertTrue($cache->inCache('test.txt')); - $cache->update($cache->getId('test.txt'), ['permissions' => \OCP\Constants::PERMISSION_READ]); - $this->assertEquals(\OCP\Constants::PERMISSION_READ, $this->instance->getPermissions('test.txt')); + $cache->update($cache->getId('test.txt'), ['permissions' => Constants::PERMISSION_READ]); + $this->assertEquals(Constants::PERMISSION_READ, $this->instance->getPermissions('test.txt')); $this->assertTrue($this->instance->copy('test.txt', 'new.txt')); $this->assertTrue($cache->inCache('new.txt')); - $this->assertEquals(\OCP\Constants::PERMISSION_READ, $this->instance->getPermissions('new.txt')); + $this->assertEquals(Constants::PERMISSION_READ, $this->instance->getPermissions('new.txt')); } /** @@ -254,13 +255,13 @@ class ObjectStoreStorageTest extends Storage { $instance->file_put_contents('test.txt', 'foo'); $this->assertTrue($cache->inCache('test.txt')); - $cache->update($cache->getId('test.txt'), ['permissions' => \OCP\Constants::PERMISSION_READ]); - $this->assertEquals(\OCP\Constants::PERMISSION_READ, $instance->getPermissions('test.txt')); + $cache->update($cache->getId('test.txt'), ['permissions' => Constants::PERMISSION_READ]); + $this->assertEquals(Constants::PERMISSION_READ, $instance->getPermissions('test.txt')); $this->assertTrue($instance->copy('test.txt', 'new.txt')); $this->assertTrue($cache->inCache('new.txt')); - $this->assertEquals(\OCP\Constants::PERMISSION_ALL, $instance->getPermissions('new.txt')); + $this->assertEquals(Constants::PERMISSION_ALL, $instance->getPermissions('new.txt')); } public function testCopyFolderSize(): void { diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php index 76fc80c975f..d3c282d0427 100644 --- a/tests/lib/Files/ObjectStore/S3Test.php +++ b/tests/lib/Files/ObjectStore/S3Test.php @@ -8,6 +8,8 @@ namespace Test\Files\ObjectStore; use Icewind\Streams\Wrapper; use OC\Files\ObjectStore\S3; +use OCP\IConfig; +use OCP\Server; class MultiPartUploadS3 extends S3 { public function writeObject($urn, $stream, ?string $mimetype = null) { @@ -52,7 +54,7 @@ class S3Test extends ObjectStoreTestCase { } protected function getInstance() { - $config = \OC::$server->getConfig()->getSystemValue('objectstore'); + $config = Server::get(IConfig::class)->getSystemValue('objectstore'); if (!is_array($config) || $config['class'] !== S3::class) { $this->markTestSkipped('objectstore not configured for s3'); } diff --git a/tests/lib/Files/ObjectStore/SwiftTest.php b/tests/lib/Files/ObjectStore/SwiftTest.php index 9fb8c9bb68e..2321d8eafda 100644 --- a/tests/lib/Files/ObjectStore/SwiftTest.php +++ b/tests/lib/Files/ObjectStore/SwiftTest.php @@ -8,6 +8,8 @@ namespace Test\Files\ObjectStore; use OC\Files\ObjectStore\Swift; +use OCP\IConfig; +use OCP\Server; /** * @group PRIMARY-swift @@ -17,7 +19,7 @@ class SwiftTest extends ObjectStoreTestCase { * @return \OCP\Files\ObjectStore\IObjectStore */ protected function getInstance() { - $config = \OC::$server->getConfig()->getSystemValue('objectstore'); + $config = Server::get(IConfig::class)->getSystemValue('objectstore'); if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\Swift') { $this->markTestSkipped('objectstore not configured for swift'); } |