/** * @test * @group unit */ public function deserialized_and_serialized_event_has_same_values() { $id = new PollId(); $data = array('pollId' => (string) $id, 'title' => 'Title'); $event = PollCreatedEvent::deserialize($data); $this->assertSame($data, $event->serialize()); }
public function applyPollCreatedEvent(PollCreatedEvent $event) { $poll = new Poll((string) $event->getPollId(), $event->getTitle()); $this->repository->save($poll); }
/** * @param PollCreatedEvent $event */ protected function applyPollCreatedEvent(PollCreatedEvent $event) { $id = $event->getPollId(); $title = $event->getTitle(); $this->id = $id; $this->title = $title; $this->options = array(); }