protected function execute(InputInterface $input, OutputInterface $output) { $tasks = $this->listsTasksHandler->handle(); $taskDescription = $this->showTasksToDelete($input, $output, $tasks); $this->commandHandler->handle(new DeleteTaskCommand($taskDescription)); $output->writeln('You have just deleted: ' . $taskDescription); }
/** * @expectedException \JGimeno\TaskReporter\Domain\Exception\EmptyWorkingDayException * @expectedExceptionMessage You have not defined any task for today. */ public function testWhenNoWorkingDayExistsThrowsException() { $repo = new InMemoryWorkingDayRepository(); $listTasksHandler = new ListTasksHandler($repo); $listTasksHandler->handle(new ListTasks()); }
protected function execute(InputInterface $input, OutputInterface $output) { $tasks = $this->commandHandler->handle(new ListTasksCommand()); $listTasksPresentation = new ListTasksPresentation($output); $listTasksPresentation->render($tasks); }