/**
  * @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());
 }
Beispiel #2
0
 public function applyPollCreatedEvent(PollCreatedEvent $event)
 {
     $poll = new Poll((string) $event->getPollId(), $event->getTitle());
     $this->repository->save($poll);
 }
Beispiel #3
0
 /**
  * @param PollCreatedEvent $event
  */
 protected function applyPollCreatedEvent(PollCreatedEvent $event)
 {
     $id = $event->getPollId();
     $title = $event->getTitle();
     $this->id = $id;
     $this->title = $title;
     $this->options = array();
 }