diff options
Diffstat (limited to 'tests/lib/Files/ObjectStore')
-rw-r--r-- | tests/lib/Files/ObjectStore/ObjectStoreStoragesDifferentBucketTest.php | 39 | ||||
-rw-r--r-- | tests/lib/Files/ObjectStore/ObjectStoreStoragesSameBucketTest.php | 31 |
2 files changed, 70 insertions, 0 deletions
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStoragesDifferentBucketTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStoragesDifferentBucketTest.php new file mode 100644 index 00000000000..1915460777c --- /dev/null +++ b/tests/lib/Files/ObjectStore/ObjectStoreStoragesDifferentBucketTest.php @@ -0,0 +1,39 @@ +<?php +/** + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +namespace Test\Files\ObjectStore; + +use Test\Files\Storage\StoragesTest; + +/** + * @group DB + */ +class ObjectStoreStoragesDifferentBucketTest extends StoragesTest { + /** + * @var \OCP\Files\ObjectStore\IObjectStore + */ + private $objectStore1; + + /** + * @var \OCP\Files\ObjectStore\IObjectStore + */ + private $objectStore2; + + protected function setUp(): void { + parent::setUp(); + + $baseStorage1 = new Temporary(); + $this->objectStore1 = new StorageObjectStore($baseStorage1); + $config['objectstore'] = $this->objectStore1; + $this->storage1 = new ObjectStoreStorageOverwrite($config); + + $baseStorage2 = new Temporary(); + $this->objectStore2 = new StorageObjectStore($baseStorage2); + $config['objectstore'] = $this->objectStore2; + $this->storage2 = new ObjectStoreStorageOverwrite($config); + } +} diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStoragesSameBucketTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStoragesSameBucketTest.php new file mode 100644 index 00000000000..71011451a53 --- /dev/null +++ b/tests/lib/Files/ObjectStore/ObjectStoreStoragesSameBucketTest.php @@ -0,0 +1,31 @@ +<?php +/** + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +namespace Test\Files\ObjectStore; + +use Test\Files\Storage\StoragesTest; + +/** + * @group DB + */ +class ObjectStoreStoragesSameBucketTest extends StoragesTest { + /** + * @var \OCP\Files\ObjectStore\IObjectStore + */ + private $objectStore; + + protected function setUp(): void { + parent::setUp(); + + $baseStorage = new Temporary(); + $this->objectStore = new StorageObjectStore($baseStorage); + $config['objectstore'] = $this->objectStore; + // storage1 and storage2 share the same object store. + $this->storage1 = new ObjectStoreStorageOverwrite($config); + $this->storage2 = new ObjectStoreStorageOverwrite($config); + } +} |