2015-12-03 15:53:58 -05:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2024-05-10 09:09:14 -04:00
|
|
|
/**
|
|
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
*/
|
2015-12-03 15:53:58 -05:00
|
|
|
namespace Test\Comments;
|
2020-04-09 05:48:10 -04:00
|
|
|
|
2022-01-27 11:07:48 -05:00
|
|
|
use OC\Comments\Comment;
|
2017-08-30 04:56:02 -04:00
|
|
|
use OCP\Comments\IComment;
|
|
|
|
|
use OCP\Comments\ICommentsManager;
|
2017-03-30 04:44:05 -04:00
|
|
|
use OCP\IUser;
|
2015-12-03 15:53:58 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class FakeManager
|
|
|
|
|
*/
|
2017-08-30 04:56:02 -04:00
|
|
|
class FakeManager implements ICommentsManager {
|
2026-01-06 08:11:50 -05:00
|
|
|
public function get($id): IComment {
|
|
|
|
|
throw new \Exception('Not implemented');
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function getTree($id, $limit = 0, $offset = 0): array {
|
|
|
|
|
return ['comment' => new Comment(), 'replies' => []];
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
|
|
|
|
public function getForObject(
|
|
|
|
|
$objectType,
|
|
|
|
|
$objectId,
|
|
|
|
|
$limit = 0,
|
|
|
|
|
$offset = 0,
|
2024-09-19 05:10:31 -04:00
|
|
|
?\DateTime $notOlderThan = null,
|
2026-01-06 08:11:50 -05:00
|
|
|
): array {
|
|
|
|
|
return [];
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2018-04-19 11:12:07 -04:00
|
|
|
public function getForObjectSince(
|
|
|
|
|
string $objectType,
|
|
|
|
|
string $objectId,
|
|
|
|
|
int $lastKnownCommentId,
|
|
|
|
|
string $sortDirection = 'asc',
|
2020-10-22 04:54:03 -04:00
|
|
|
int $limit = 30,
|
2024-09-19 05:10:31 -04:00
|
|
|
bool $includeLastKnown = false,
|
2025-07-10 15:43:50 -04:00
|
|
|
string $topmostParentId = '',
|
2020-04-10 08:19:56 -04:00
|
|
|
): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2018-04-19 11:12:07 -04:00
|
|
|
|
2022-01-21 08:02:34 -05:00
|
|
|
public function getCommentsWithVerbForObjectSinceComment(
|
|
|
|
|
string $objectType,
|
|
|
|
|
string $objectId,
|
|
|
|
|
array $verbs,
|
|
|
|
|
int $lastKnownCommentId,
|
|
|
|
|
string $sortDirection = 'asc',
|
|
|
|
|
int $limit = 30,
|
2024-09-19 05:10:31 -04:00
|
|
|
bool $includeLastKnown = false,
|
2025-07-10 15:43:50 -04:00
|
|
|
string $topmostParentId = '',
|
2022-01-21 08:02:34 -05:00
|
|
|
): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-28 02:57:10 -04:00
|
|
|
public function getNumberOfCommentsForObject($objectType, $objectId, ?\DateTime $notOlderThan = null, $verb = ''): int {
|
2026-01-06 08:11:50 -05:00
|
|
|
return 0;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2025-08-28 02:57:10 -04:00
|
|
|
public function getNumberOfCommentsForObjects(string $objectType, array $objectIds, ?\DateTime $notOlderThan = null, string $verb = ''): array {
|
2025-08-13 08:44:27 -04:00
|
|
|
return array_fill_keys($objectIds, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-23 08:58:43 -04:00
|
|
|
public function search(string $search, string $objectType, string $objectId, string $verb, int $offset, int $limit = 50): array {
|
2018-04-18 05:29:49 -04:00
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function create($actorType, $actorId, $objectType, $objectId): IComment {
|
|
|
|
|
return new Comment();
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function delete($id): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2022-01-27 11:07:48 -05:00
|
|
|
public function getReactionComment(int $parentId, string $actorType, string $actorId, string $reaction): IComment {
|
|
|
|
|
return new Comment();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function retrieveAllReactions(int $parentId): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function retrieveAllReactionsWithSpecificReaction(int $parentId, string $reaction): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function supportReactions(): bool {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function save(IComment $comment): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function deleteReferencesOfActor($actorType, $actorId): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function deleteCommentsAtObject($objectType, $objectId): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-01-27 12:30:09 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function setReadMark($objectType, $objectId, \DateTime $dateTime, IUser $user): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-01-27 12:30:09 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function getReadMark($objectType, $objectId, IUser $user): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-01-28 16:59:48 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function deleteReadMarksFromUser(IUser $user): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-01-28 16:59:48 -05:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function deleteReadMarksOnObject($objectType, $objectId): bool {
|
|
|
|
|
return false;
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-05-09 04:02:07 -04:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function registerEventHandler(\Closure $closure): void {
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-10-20 08:32:32 -04:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function registerDisplayNameResolver($type, \Closure $closure): void {
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2016-10-20 08:32:32 -04:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function resolveDisplayName($type, $id): string {
|
|
|
|
|
return '';
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2017-03-30 04:44:05 -04:00
|
|
|
|
2026-01-06 08:11:50 -05:00
|
|
|
public function getNumberOfUnreadCommentsForFolder($folderId, IUser $user): array {
|
|
|
|
|
return [];
|
2020-04-10 08:19:56 -04:00
|
|
|
}
|
2017-08-30 04:56:02 -04:00
|
|
|
|
2020-10-30 07:10:59 -04:00
|
|
|
public function getNumberOfUnreadCommentsForObjects(string $objectType, array $objectIds, IUser $user, $verb = ''): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-19 03:49:04 -04:00
|
|
|
public function load(): void {
|
|
|
|
|
}
|
2020-10-22 04:54:03 -04:00
|
|
|
|
|
|
|
|
public function searchForObjects(string $search, string $objectType, array $objectIds, string $verb, int $offset, int $limit = 50): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getNumberOfCommentsForObjectSinceComment(string $objectType, string $objectId, int $lastRead, string $verb = ''): int {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-05 05:53:33 -05:00
|
|
|
public function getNumberOfCommentsWithVerbsForObjectSinceComment(string $objectType, string $objectId, int $lastRead, array $verbs): int {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-22 04:54:03 -04:00
|
|
|
public function getLastCommentBeforeDate(string $objectType, string $objectId, \DateTime $beforeDate, string $verb = ''): int {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getLastCommentDateByActor(string $objectType, string $objectId, string $verb, string $actorType, array $actors): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2022-06-13 11:22:36 -04:00
|
|
|
|
2022-07-01 10:38:58 -04:00
|
|
|
public function deleteCommentsExpiredAtObject(string $objectType, string $objectId = ''): bool {
|
2022-06-13 11:22:36 -04:00
|
|
|
return true;
|
|
|
|
|
}
|
2015-12-03 15:53:58 -05:00
|
|
|
}
|