示例#1
0
 public function test_non_admin_cannot_remove_comment()
 {
     \Auth::shouldReceive('user')->once()->andReturn(DummyUser::where(['is_admin' => 0])->first());
     $comment = Comment::where(['body' => 'My Comment 1'])->first();
     $this->assertEquals($comment->body, 'My Comment 1');
     $result = \Mural::remove($comment->id);
     $comment = Comment::where(['body' => 'My Comment 1'])->first();
     $this->assertEquals($comment->body, 'My Comment 1');
     $this->assertEquals($result, false);
 }
 public function delete($id)
 {
     return \Mural::remove($id);
 }