1
0

ObjectStoreStorageOverwrite.php 710 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace Test\Files\ObjectStore;
  8. use OC\Files\ObjectStore\ObjectStoreStorage;
  9. use OCP\Files\ObjectStore\IObjectStore;
  10. /**
  11. * Allow overwriting the object store instance for test purposes
  12. */
  13. class ObjectStoreStorageOverwrite extends ObjectStoreStorage {
  14. public function setObjectStore(IObjectStore $objectStore): void {
  15. $this->objectStore = $objectStore;
  16. }
  17. public function getObjectStore(): IObjectStore {
  18. return $this->objectStore;
  19. }
  20. public function setValidateWrites(bool $validate): void {
  21. $this->validateWrites = $validate;
  22. }
  23. }