diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2016-01-27 18:30:09 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2016-01-29 13:08:02 +0100 |
commit | d2882b9021a0c46b5d1603d23e8c4705b7283990 (patch) | |
tree | 28ebec337a575615760d9b34264814ed62a6c591 /tests/lib | |
parent | b65a23ca4b41ee7ce6290eacde44caeb70a00b2e (diff) | |
download | nextcloud-server-d2882b9021a0c46b5d1603d23e8c4705b7283990.tar.gz nextcloud-server-d2882b9021a0c46b5d1603d23e8c4705b7283990.zip |
Comments WebDAV adjustements
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/comments/fakemanager.php | 6 | ||||
-rw-r--r-- | tests/lib/comments/manager.php | 16 |
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); + } + } |