예제 #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $task = $input->getArgument('task');
     $command = new AddTask($task);
     $this->commandHandler->handle($command);
     $output->writeln("Task added.");
 }
예제 #2
0
 public function testICanAddATaskFromCommand()
 {
     $command = new AddTask("Task test");
     $this->commandHandler->handle($command);
     $workingDayFromRepo = $this->workingDayRepo->getByDate(Carbon::now());
     $expectedWorkingDay = new WorkingDay(WorkingDayId::generate());
     $expectedWorkingDay->addTask(new Task("Task test"));
     $this->assertEquals($expectedWorkingDay->getDate(), $workingDayFromRepo->getDate());
 }
예제 #3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     global $em;
     // Todo better injection of entity manager.
     $task = $input->getArgument('task');
     $command = new AddTask($task);
     $commandHandler = new AddTaskHandler(new DoctrineWorkingDayRepository($em));
     $commandHandler->handle($command);
     $output->writeln("Task added.");
 }