/** * @expectedException OutOfBoundsException */ public function testFindByIdIfNotExists() { $this->userRepository->findById('123'); }
/** * Remove the specified resource from storage. * * @param int $id * * @return \Illuminate\Http\Response */ public function destroy($id) { $user = $this->userRepository->findById($id); return response()->json($this->userRepository->delete($user)); }