예제 #1
0
 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);
 }
예제 #2
0
 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;
 }