public function test_archive_non_existent_checklist() { $this->setExpectedException('DomainException'); $repository = $this->getRepositoryMock(null); $useCase = new ArchiveChecklist($repository); $command = new ArchiveChecklistCommand(1); $useCase->execute($command); }
public function archiveAction($id) { try { $command = new ArchiveChecklistCommand($id); $useCase = new ArchiveChecklistUseCase($this->repository); $useCase->execute($command); } catch (Exception $e) { $this->container['session']->getFlashBag()->add('error', $e->getMessage()); } return new Response(); }