/** * Test loading simple comments from source */ public function testAddComment() { /** * @var CommentInterface $comment */ $comment = $this->commentManager->addComment('source', 'context', 'This is my content', '12345', 'Marc Morera', '*****@*****.**', null); $this->assertEquals('source', $comment->getSource()); $this->assertGreaterThan(0, $comment->getId()); $this->assertEquals('This is my content', $comment->getContent()); }
/** * Delete a comment. * * @param int $commentId Comment id * @param string $authorToken Author token * * @return Response * * @throws EntityNotFoundException Comment not found */ public function deleteCommentAction($commentId, $authorToken) { $comment = $this->findComment($commentId, $authorToken); $this->commentManager->removeComment($comment); return new Response(); }