Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7dcc449
test(ObjectStore): establish StorageBackedObjectStore
joshtrichards Mar 28, 2026
6aa2658
chore(ObjectStore): delete StorageObjectStore
joshtrichards Mar 28, 2026
2be19ea
chore(OO): change to test namespace
joshtrichards Mar 28, 2026
74cb706
chore: switch LocalTest to StorageBackedObjectStore
joshtrichards Mar 28, 2026
edb9895
chore: switch ObjectStoreStorageTest to StorageBackedObjectStore
joshtrichards Mar 28, 2026
1c75f2d
chore: switch ObjectStoreStoragesSameBucketTest to StorageBackedObjec…
joshtrichards Mar 28, 2026
0d0d700
chore: switch ObjectStoreStoragesDifferentBucketTest to StorageBacked…
joshtrichards Mar 28, 2026
02d1dbd
chore: switch UpdaterTest to StorageBackedObjectStore
joshtrichards Mar 28, 2026
a9eef0a
chore: switch PrimaryObjectStoreConfigTest to StorageBackedObjectStore
joshtrichards Mar 28, 2026
fb5f98c
chore: drop StorageObjectStore from prod autoload_static.php
joshtrichards Mar 28, 2026
d5acfff
chore: drop StorageObjectStore from prod autoload_classmap
joshtrichards Mar 28, 2026
c10aa29
chore: fixup ObjectStoreStorageTest to really new StorageBackedObject…
joshtrichards Mar 28, 2026
6064165
chore: fixup LocalTest to import from correct ns
joshtrichards Mar 28, 2026
07e0a49
chore: drop no longer necessary import
joshtrichards Mar 28, 2026
d67cb44
chore: drop no longer necessary import
joshtrichards Mar 28, 2026
1619673
chore: drop no longer necessary import
joshtrichards Mar 28, 2026
5ec1fd3
chore: drop no longer necessary import
joshtrichards Mar 28, 2026
d182f6f
chore: make cs happy
joshtrichards Mar 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,6 @@
'OC\\Files\\ObjectStore\\S3ConnectionTrait' => $baseDir . '/lib/private/Files/ObjectStore/S3ConnectionTrait.php',
'OC\\Files\\ObjectStore\\S3ObjectTrait' => $baseDir . '/lib/private/Files/ObjectStore/S3ObjectTrait.php',
'OC\\Files\\ObjectStore\\S3Signature' => $baseDir . '/lib/private/Files/ObjectStore/S3Signature.php',
'OC\\Files\\ObjectStore\\StorageObjectStore' => $baseDir . '/lib/private/Files/ObjectStore/StorageObjectStore.php',
'OC\\Files\\ObjectStore\\Swift' => $baseDir . '/lib/private/Files/ObjectStore/Swift.php',
'OC\\Files\\ObjectStore\\SwiftFactory' => $baseDir . '/lib/private/Files/ObjectStore/SwiftFactory.php',
'OC\\Files\\ObjectStore\\SwiftV2CachingAuthService' => $baseDir . '/lib/private/Files/ObjectStore/SwiftV2CachingAuthService.php',
Expand Down
1 change: 0 additions & 1 deletion lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OC\\Files\\ObjectStore\\S3ConnectionTrait' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/S3ConnectionTrait.php',
'OC\\Files\\ObjectStore\\S3ObjectTrait' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/S3ObjectTrait.php',
'OC\\Files\\ObjectStore\\S3Signature' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/S3Signature.php',
'OC\\Files\\ObjectStore\\StorageObjectStore' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/StorageObjectStore.php',
'OC\\Files\\ObjectStore\\Swift' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/Swift.php',
'OC\\Files\\ObjectStore\\SwiftFactory' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/SwiftFactory.php',
'OC\\Files\\ObjectStore\\SwiftV2CachingAuthService' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/SwiftV2CachingAuthService.php',
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Files/Cache/UpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use OC\Files\Cache\Updater;
use OC\Files\Filesystem;
use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\StorageObjectStore;
use OC\Files\Storage\Storage;
use OC\Files\Storage\Temporary;
use OC\Files\View;
use OCP\Files\Storage\IStorage;
use Test\Files\ObjectStore\StorageBackedObjectStore;

/**
* Class UpdaterTest
Expand Down Expand Up @@ -313,7 +313,7 @@ public function testMoveFolderCrossStorage(): void {
public static function changeExtensionProvider(): array {
return [
[new Temporary()],
[new ObjectStoreStorage(['objectstore' => new StorageObjectStore(new Temporary())])]
[new ObjectStoreStorage(['objectstore' => new StorageBackedObjectStore(new Temporary())])]
];
}

Expand Down
3 changes: 1 addition & 2 deletions tests/lib/Files/ObjectStore/LocalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
namespace Test\Files\ObjectStore;

use OC\Files\ObjectStore\StorageObjectStore;
use OC\Files\Storage\Temporary;
use OCP\Files\ObjectStore\IObjectStore;

Expand All @@ -18,6 +17,6 @@ class LocalTest extends ObjectStoreTestCase {
*/
protected function getInstance() {
$storage = new Temporary();
return new StorageObjectStore($storage);
return new StorageBackedObjectStore($storage);
}
}
3 changes: 1 addition & 2 deletions tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Test\Files\ObjectStore;

use OC\Files\ObjectStore\StorageObjectStore;
use OC\Files\Storage\Temporary;
use OC\Files\Storage\Wrapper\Jail;
use OCP\Constants;
Expand All @@ -29,7 +28,7 @@ protected function setUp(): void {
parent::setUp();

$baseStorage = new Temporary();
$this->objectStorage = new StorageObjectStore($baseStorage);
$this->objectStorage = new StorageBackedObjectStore($baseStorage);
$config['objectstore'] = $this->objectStorage;
$this->instance = new ObjectStoreStorageOverwrite($config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
namespace Test\Files\ObjectStore;

use OC\Files\ObjectStore\StorageObjectStore;
use OC\Files\Storage\Temporary;
use OCP\Files\ObjectStore\IObjectStore;
use Test\Files\Storage\StoragesTestCase;
Expand All @@ -30,12 +29,12 @@ protected function setUp(): void {
parent::setUp();

$baseStorage1 = new Temporary();
$this->objectStore1 = new StorageObjectStore($baseStorage1);
$this->objectStore1 = new StorageBackedObjectStore($baseStorage1);
$config['objectstore'] = $this->objectStore1;
$this->storage1 = new ObjectStoreStorageOverwrite($config);

$baseStorage2 = new Temporary();
$this->objectStore2 = new StorageObjectStore($baseStorage2);
$this->objectStore2 = new StorageBackedObjectStore($baseStorage2);
$config['objectstore'] = $this->objectStore2;
$this->storage2 = new ObjectStoreStorageOverwrite($config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
namespace Test\Files\ObjectStore;

use OC\Files\ObjectStore\StorageObjectStore;
use OC\Files\Storage\Temporary;
use OCP\Files\ObjectStore\IObjectStore;
use Test\Files\Storage\StoragesTestCase;
Expand All @@ -25,7 +24,7 @@ protected function setUp(): void {
parent::setUp();

$baseStorage = new Temporary();
$this->objectStore = new StorageObjectStore($baseStorage);
$this->objectStore = new StorageBackedObjectStore($baseStorage);
$config['objectstore'] = $this->objectStore;
// storage1 and storage2 share the same object store.
$this->storage1 = new ObjectStoreStorageOverwrite($config);
Expand Down
34 changes: 17 additions & 17 deletions tests/lib/Files/ObjectStore/PrimaryObjectStoreConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
namespace lib\Files\ObjectStore;

use OC\Files\ObjectStore\PrimaryObjectStoreConfig;
use OC\Files\ObjectStore\StorageObjectStore;
use OCP\App\IAppManager;
use OCP\IConfig;
use OCP\IUser;
use PHPUnit\Framework\MockObject\MockObject;
use Test\Files\ObjectStore\StorageBackedObjectStore;
use Test\TestCase;

class PrimaryObjectStoreConfigTest extends TestCase {
Expand Down Expand Up @@ -68,7 +68,7 @@ public function testNewUserGetsDefault() {
$this->setConfig('objectstore', [
'default' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
],
Expand All @@ -88,14 +88,14 @@ public function testExistingUserKeepsStorage() {
$this->setConfig('objectstore', [
'default' => 'server2',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'bucket' => '1',
],
],
'server2' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server2',
'bucket' => '2',
Expand All @@ -118,7 +118,7 @@ public function testNestedAliases() {
'a1' => 'a2',
'a2' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'bucket' => '1',
Expand All @@ -132,7 +132,7 @@ public function testMultibucketChangedConfig() {
$this->setConfig('objectstore', [
'default' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'multibucket' => true,
Expand All @@ -149,7 +149,7 @@ public function testMultibucketChangedConfig() {
$this->setConfig('objectstore', [
'default' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'multibucket' => true,
Expand All @@ -170,7 +170,7 @@ public function testMultibucketChangedConfig() {
$this->setConfig('objectstore', [
'default' => 'server2',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'multibucket' => true,
Expand All @@ -179,7 +179,7 @@ public function testMultibucketChangedConfig() {
],
],
'server2' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server2',
'multibucket' => true,
Expand All @@ -200,7 +200,7 @@ public function testMultibucketChangedConfig() {

public function testMultibucketOldConfig() {
$this->setConfig('objectstore_multibucket', [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'multibucket' => true,
Expand All @@ -214,7 +214,7 @@ public function testMultibucketOldConfig() {
'root' => 'server1',
'preview' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'multibucket' => true,
Expand All @@ -227,7 +227,7 @@ public function testMultibucketOldConfig() {

public function testSingleObjectStore() {
$this->setConfig('objectstore', [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
],
Expand All @@ -238,7 +238,7 @@ public function testSingleObjectStore() {
'root' => 'server1',
'preview' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'multibucket' => false,
Expand All @@ -251,14 +251,14 @@ public function testRoot() {
$this->setConfig('objectstore', [
'default' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'bucket' => '1',
],
],
'server2' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server2',
'bucket' => '2',
Expand All @@ -274,14 +274,14 @@ public function testRoot() {
'root' => 'server2',
'preview' => 'server1',
'server1' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server1',
'bucket' => '1',
],
],
'server2' => [
'class' => StorageObjectStore::class,
'class' => StorageBackedObjectStore::class,
'arguments' => [
'host' => 'server2',
'bucket' => '2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Files\ObjectStore;
namespace Test\Files\ObjectStore;

use OCP\Files\ObjectStore\IObjectStore;
use OCP\Files\Storage\IStorage;
use function is_resource;

/**
* Object store that wraps a storage backend, mostly for testing purposes
* Object store that wraps a storage backend, for testing purposes
*/
class StorageObjectStore implements IObjectStore {
class StorageBackedObjectStore implements IObjectStore {
public function __construct(
private IStorage $storage,
) {
Expand Down
Loading