0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-23 08:28:36 +00:00
nextcloud_server/tests/lib/Files/ObjectStore/FailWriteObjectStore.php
Andy Scherzinger 1f7e2ba599
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +02:00

44 lines
997 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Files\ObjectStore;
use OCP\Files\ObjectStore\IObjectStore;
class FailWriteObjectStore implements IObjectStore {
private $objectStore;
public function __construct(IObjectStore $objectStore) {
$this->objectStore = $objectStore;
}
public function getStorageId() {
return $this->objectStore->getStorageId();
}
public function readObject($urn) {
return $this->objectStore->readObject($urn);
}
public function writeObject($urn, $stream, ?string $mimetype = null) {
// emulate a failed write that didn't throw an error
return true;
}
public function deleteObject($urn) {
$this->objectStore->deleteObject($urn);
}
public function objectExists($urn) {
return $this->objectStore->objectExists($urn);
}
public function copyObject($from, $to) {
$this->objectStore->copyObject($from, $to);
}
}