aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php
blob: 767125d42aa224e95d584a4e694cbd8d9099a093 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

declare(strict_types=1);
/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

namespace Test\Files\ObjectStore;

use OCP\Files\ObjectStore\IObjectStore;

class FailDeleteObjectStore implements IObjectStore {
	public function __construct(
		private IObjectStore $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) {
		return $this->objectStore->writeObject($urn, $stream, $mimetype);
	}

	public function deleteObject($urn) {
		throw new \Exception();
	}

	public function objectExists($urn) {
		return $this->objectStore->objectExists($urn);
	}

	public function copyObject($from, $to) {
		$this->objectStore->copyObject($from, $to);
	}
}