Beispiel #1
0
 /**
  * @param PollCreatedEvent $event
  */
 protected function applyPollCreatedEvent(PollCreatedEvent $event)
 {
     $id = $event->getPollId();
     $title = $event->getTitle();
     $this->id = $id;
     $this->title = $title;
     $this->options = array();
 }
Beispiel #2
0
 public function applyPollCreatedEvent(PollCreatedEvent $event)
 {
     $poll = new Poll((string) $event->getPollId(), $event->getTitle());
     $this->repository->save($poll);
 }
 /**
  * @test
  * @group unit
  */
 public function get_poll_id_returns_correct_id()
 {
     $id = new PollId();
     $event = new PollCreatedEvent($id, 'Title');
     $this->assertEquals($id, $event->getPollId());
 }