public function testCommentJudge() { $comment = factory(Comment::class, 1)->create(); $result = $this->commentJudgeService->commentJudge($comment->id, 1); $this->assertTrue($result); $result = $this->commentJudgeService->commentJudge($comment->id, 1); $this->assertFalse($result); }
public function loveComment($comment_id, $option) { $result = []; if ($this->commentJudgeService->commentJudge($comment_id, $option)) { $result['status'] = "success"; } else { $result['status'] = "failed"; $result['msg'] = "已經按過評論囉!"; } return $result; }