コード例 #1
0
 /**
  * @param int $imageId
  *
  * @throws \Exception
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy(int $imageId)
 {
     $this->imageRepository->deleteById($imageId);
     return $this->redirectToImagesIndex();
 }
コード例 #2
0
 /**
  * Should be able to delete an image by ID.
  */
 public function testDeleteById()
 {
     $this->imageResource->shouldReceive('where->limit->delete')->atLeast()->once()->andReturn(true);
     $deleted = $this->imageRepository->deleteById($this->generator()->anyInteger());
     $this->assertTrue($deleted);
 }