summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-10-27 19:57:55 +0100
committerGitHub <noreply@github.com>2020-10-27 19:57:55 +0100
commiteadce7fadd652978a0f64c39f983e28b2a657a94 (patch)
treee62095f7cdbc1d3433818febd7ba4764305b2126 /tests
parent49854f58d31a8e2d2f9dd24e17a14357dc8f4da9 (diff)
parentda3d384426d0e00561a23ded4f3dafe56b5f761f (diff)
downloadnextcloud-server-eadce7fadd652978a0f64c39f983e28b2a657a94.tar.gz
nextcloud-server-eadce7fadd652978a0f64c39f983e28b2a657a94.zip
Merge pull request #23601 from nextcloud/techdebt/noid/comments-manager-improvements
Comments manager improvements/extensions needed by Talk
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Comments/FakeManager.php19
-rw-r--r--tests/lib/Comments/ManagerTest.php15
2 files changed, 30 insertions, 4 deletions
diff --git a/tests/lib/Comments/FakeManager.php b/tests/lib/Comments/FakeManager.php
index 91c8d4b7d58..29fb3934362 100644
--- a/tests/lib/Comments/FakeManager.php
+++ b/tests/lib/Comments/FakeManager.php
@@ -30,7 +30,8 @@ class FakeManager implements ICommentsManager {
string $objectId,
int $lastKnownCommentId,
string $sortDirection = 'asc',
- int $limit = 30
+ int $limit = 30,
+ bool $includeLastKnown = false
): array {
return [];
}
@@ -86,4 +87,20 @@ class FakeManager implements ICommentsManager {
public function load(): void {
}
+
+ 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;
+ }
+
+ 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 [];
+ }
}
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php
index def00fd0dcc..355b1af1347 100644
--- a/tests/lib/Comments/ManagerTest.php
+++ b/tests/lib/Comments/ManagerTest.php
@@ -3,13 +3,17 @@
namespace Test\Comments;
use OC\Comments\Comment;
-use OC\Comments\ManagerFactory;
+use OC\Comments\Manager;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Comments\IComment;
use OCP\Comments\ICommentsEventHandler;
use OCP\Comments\ICommentsManager;
use OCP\Comments\NotFoundException;
+use OCP\IConfig;
use OCP\IDBConnection;
+use OCP\IInitialStateService;
use OCP\IUser;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
/**
@@ -63,8 +67,13 @@ class ManagerTest extends TestCase {
}
protected function getManager() {
- $factory = new ManagerFactory(\OC::$server);
- return $factory->getManager();
+ return new Manager(
+ $this->connection,
+ $this->createMock(LoggerInterface::class),
+ $this->createMock(IConfig::class),
+ $this->createMock(ITimeFactory::class),
+ $this->createMock(IInitialStateService::class)
+ );
}