Exemplo n.º 1
0
 /**
  * @param int $tagId
  *
  * @throws \Exception
  *
  * @return RedirectResponse
  */
 public function destroy(int $tagId)
 {
     $deleted = $this->tagRepository->deleteById($tagId);
     if ($deleted) {
         $this->webUi->successMessage("Deleted tag with ID `{$tagId}`");
     } else {
         $this->webUi->errorMessage("Failed to delete tag with ID `{$tagId}`");
     }
     return $this->redirectToTagsIndex();
 }
Exemplo n.º 2
0
 /**
  * Should be able to delete a tag by id.
  */
 public function testDeleteById()
 {
     $this->tagModel->shouldReceive('where->first->delete')->andReturnTrue();
     $this->assertTrue($this->tagRepository->deleteById(5));
 }