/** * @param CreatePoll $command */ public function handleCreatePoll(CreatePoll $command) { $id = $command->getPollId(); $name = $command->getTitle(); $poll = Poll::create($id, $name); $this->repository->add($poll); }
/** * @test * @group unit * @expectedException Pollo\Core\Domain\Command\Exception\CannotDeserializeCommand */ public function invalid_serialized_data_should_throw_exception() { $serialized = array(); CreatePoll::deserialize($serialized); }