/** * @param VoteOption $command */ public function handleVoteOption(VoteOption $command) { $pollId = $command->getPollId(); $optionNumber = $command->getOptionNumber(); /** @var Poll $poll */ $poll = $this->repository->load($pollId); $poll->vote($optionNumber); $this->repository->add($poll); }
/** * @test * @group unit * @expectedException Pollo\Core\Domain\Command\Exception\CannotDeserializeCommand */ public function invalid_serialized_data_should_throw_exception() { $serialized = array(); VoteOption::deserialize($serialized); }