public function testUpdateCommentLike() { $comment = factory(Comment::class, 1)->create(); $result = $this->repository->updateCourseLove($comment->id, 1); $this->assertEquals($comment->love + 1, $result->love); $this->assertEquals($comment->dislike, $result->dislike); }
public function commentJudge($comment_id, $option) { if ($this->commentJudgeRepository->isJudged($comment_id)) { return false; } else { $this->commentJudgeRepository->addCommentJudgeRecord($comment_id, $option); $this->commentRepository->updateCourseLove($comment_id, $option); return true; } }