|
|
|
|
@ -76,14 +76,16 @@ class EntityCollectionTest extends \Test\TestCase { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testGetChild() { |
|
|
|
|
$comment = $this->createMock(IComment::class); |
|
|
|
|
$comment->method('getObjectType') |
|
|
|
|
->willReturn('files'); |
|
|
|
|
$comment->method('getObjectId') |
|
|
|
|
->willReturn('19'); |
|
|
|
|
|
|
|
|
|
$this->commentsManager->expects($this->once()) |
|
|
|
|
->method('get') |
|
|
|
|
->with('55') |
|
|
|
|
->willReturn( |
|
|
|
|
$this->getMockBuilder(IComment::class) |
|
|
|
|
->disableOriginalConstructor() |
|
|
|
|
->getMock() |
|
|
|
|
); |
|
|
|
|
->willReturn($comment); |
|
|
|
|
|
|
|
|
|
$node = $this->collection->getChild('55'); |
|
|
|
|
$this->assertTrue($node instanceof \OCA\DAV\Comments\CommentNode); |
|
|
|
|
@ -135,6 +137,17 @@ class EntityCollectionTest extends \Test\TestCase { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testChildExistsTrue() { |
|
|
|
|
$comment = $this->createMock(IComment::class); |
|
|
|
|
$comment->method('getObjectType') |
|
|
|
|
->willReturn('files'); |
|
|
|
|
$comment->method('getObjectId') |
|
|
|
|
->willReturn('19'); |
|
|
|
|
|
|
|
|
|
$this->commentsManager->expects($this->once()) |
|
|
|
|
->method('get') |
|
|
|
|
->with('44') |
|
|
|
|
->willReturn($comment); |
|
|
|
|
|
|
|
|
|
$this->assertTrue($this->collection->childExists('44')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|