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); }
public function testICanDeleteTaskFromTheWorkingDayFromCommand() { $workingDay = new WorkingDay(WorkingDayId::generate()); $workingDay->addTask(new Task("Task test")); $this->workingDayRepo->add($workingDay); $this->commandHandler->handle(new DeleteTask("Task test")); $this->assertCount(0, $workingDay->getTasks()); }