public function test_complete_non_existent_checklist() { $this->setExpectedException('DomainException'); $repository = $this->getRepositoryMock(null); $useCase = new CompleteChecklist($repository); $command = new CompleteChecklistCommand(1); $useCase->execute($command); }
public function completeAction($id) { try { $command = new CompleteChecklistCommand($id); $useCase = new CompleteChecklistUseCase($this->repository); $useCase->execute($command); } catch (Exception $e) { $this->container['session']->getFlashBag()->add('error', $e->getMessage()); } return new Response(); }