diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2020-04-02 12:34:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 12:34:21 +0300 |
commit | bc6a5ef5c4431ca662424dbd1125e65e74b27fa8 (patch) | |
tree | a4ca41650699b5d9f9356eb4e7d5a5a10ab15ab2 /apps/dav/tests | |
parent | c1368b86963b93a42ec98a856f8d307d922c8967 (diff) | |
parent | 1f5ba56235349ad811329b80cc1a2338dc8c79c7 (diff) |
Merge pull request #19890 from nextcloud/enh/comments-reference-id
Add optional comments reference_id
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/Comments/CommentsNodeTest.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php index 0555d09379c..a219b0a5c74 100644 --- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php +++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php @@ -108,7 +108,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->node->delete(); } - + public function testDeleteForbidden() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -150,7 +150,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->assertSame($this->node->getName(), $id); } - + public function testSetName() { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); @@ -195,7 +195,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->assertTrue($this->node->updateComment($msg)); } - + public function testUpdateCommentLogException() { $this->expectException(\Exception::class); $this->expectExceptionMessage('buh!'); @@ -236,7 +236,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->node->updateComment($msg); } - + public function testUpdateCommentMessageTooLongException() { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->expectExceptionMessage('Message exceeds allowed character limit of'); @@ -275,7 +275,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->node->updateComment('foo'); } - + public function testUpdateForbiddenByUser() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -310,7 +310,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->node->updateComment($msg); } - + public function testUpdateForbiddenByType() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -340,7 +340,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->node->updateComment($msg); } - + public function testUpdateForbiddenByNotLoggedIn() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -403,6 +403,7 @@ class CommentsNodeTest extends \Test\TestCase { $ns . 'latestChildDateTime' => new \DateTime('2016-01-12 18:48:00'), $ns . 'objectType' => 'files', $ns . 'objectId' => '1848', + $ns . 'referenceId' => 'ref', $ns . 'isUnread' => null, ]; @@ -469,6 +470,10 @@ class CommentsNodeTest extends \Test\TestCase { ->method('getObjectId') ->willReturn($expected[$ns . 'objectId']); + $this->comment->expects($this->once()) + ->method('getReferenceId') + ->willReturn($expected[$ns . 'referenceId']); + $user = $this->getMockBuilder(IUser::class) ->disableOriginalConstructor() ->getMock(); @@ -484,7 +489,7 @@ class CommentsNodeTest extends \Test\TestCase { $properties = $this->node->getProperties(null); foreach($properties as $name => $value) { - $this->assertTrue(array_key_exists($name, $expected)); + $this->assertArrayHasKey($name, $expected); $this->assertSame($expected[$name], $value); unset($expected[$name]); } |