summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2016-01-27 18:30:09 +0100
committerArthur Schiwon <blizzz@owncloud.com>2016-01-29 13:08:02 +0100
commitd2882b9021a0c46b5d1603d23e8c4705b7283990 (patch)
tree28ebec337a575615760d9b34264814ed62a6c591 /tests/lib
parentb65a23ca4b41ee7ce6290eacde44caeb70a00b2e (diff)
downloadnextcloud-server-d2882b9021a0c46b5d1603d23e8c4705b7283990.tar.gz
nextcloud-server-d2882b9021a0c46b5d1603d23e8c4705b7283990.zip
Comments WebDAV adjustements
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/comments/fakemanager.php6
-rw-r--r--tests/lib/comments/manager.php16
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/lib/comments/fakemanager.php b/tests/lib/comments/fakemanager.php
index e5cf58dda4f..8e513cb301a 100644
--- a/tests/lib/comments/fakemanager.php
+++ b/tests/lib/comments/fakemanager.php
@@ -19,7 +19,7 @@ class FakeManager implements \OCP\Comments\ICommentsManager {
\DateTime $notOlderThan = null
) {}
- public function getNumberOfCommentsForObject($objectType, $objectId) {}
+ public function getNumberOfCommentsForObject($objectType, $objectId, \DateTime $notOlderThan = null) {}
public function create($actorType, $actorId, $objectType, $objectId) {}
@@ -30,4 +30,8 @@ class FakeManager implements \OCP\Comments\ICommentsManager {
public function deleteReferencesOfActor($actorType, $actorId) {}
public function deleteCommentsAtObject($objectType, $objectId) {}
+
+ public function setReadMark($objectType, $objectId, \DateTime $dateTime, \OCP\IUser $user) {}
+
+ public function getReadMark($objectType, $objectId, \OCP\IUser $user) {}
}
diff --git a/tests/lib/comments/manager.php b/tests/lib/comments/manager.php
index cc2eebb64d1..2578fcc5189 100644
--- a/tests/lib/comments/manager.php
+++ b/tests/lib/comments/manager.php
@@ -561,4 +561,20 @@ class Test_Comments_Manager extends TestCase
$this->assertTrue($wasSuccessful);
}
+ public function testSetMarkRead() {
+ $user = $this->getMock('\OCP\IUser');
+ $user->expects($this->any())
+ ->method('getUID')
+ ->will($this->returnValue('alice'));
+
+ $dateTimeSet = new \DateTime();
+
+ $manager = $this->getManager();
+ $manager->setReadMark('files', '36', $dateTimeSet, $user);
+
+ $dateTimeGet = $manager->getReadMark('files', '36', $user);
+
+ $this->assertEquals($dateTimeGet, $dateTimeSet);
+ }
+
}