* @since 9.0.0
*/
public function getManager() {
- return new Manager(
- $this->serverContainer->getDatabaseConnection(),
- $this->serverContainer->get(LoggerInterface::class),
- $this->serverContainer->getConfig(),
- $this->serverContainer->get(IInitialStateService::class)
- );
+ return $this->serverContainer->get(Manager::class);
}
}
string $objectId,
int $lastKnownCommentId,
string $sortDirection = 'asc',
- int $limit = 30
+ int $limit = 30,
+ bool $includeLastKnown = false
): array {
return [];
}
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 [];
+ }
}
namespace Test\Comments;
use OC\Comments\Comment;
+use OC\Comments\Manager;
use OC\Comments\ManagerFactory;
+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;
/**
}
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)
+ );
}