Exemplo n.º 1
0
 /**
  * @param CreateOption $command
  */
 public function handleCreateOption(CreateOption $command)
 {
     $pollId = $command->getPollId();
     $optionName = $command->getName();
     /** @var Poll $poll */
     $poll = $this->repository->load($pollId);
     $poll->createOption($optionName);
     $this->repository->add($poll);
 }
Exemplo n.º 2
0
 /**
  * @test
  * @group unit
  */
 public function poll_id_is_returned()
 {
     $id = new PollId();
     $command = new CreateOption($id, 'Name');
     $this->assertSame($id, $command->getPollId());
 }