Beispiel #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);
 }
Beispiel #2
0
 /**
  * @test
  * @group unit
  * @expectedException Pollo\Core\Domain\Command\Exception\CannotDeserializeCommand
  */
 public function invalid_serialized_data_should_throw_exception()
 {
     $serialized = array();
     CreateOption::deserialize($serialized);
 }