Пример #1
0
 /**
  * @param OptionVotedEvent $event
  */
 protected function applyOptionVotedEvent(OptionVotedEvent $event)
 {
     $number = $event->getOptionNumber();
     if ($number === $this->number) {
         $this->votes++;
     }
 }
Пример #2
0
 /**
  * @test
  * @group unit
  */
 public function deserialized_and_serialized_event_has_same_values()
 {
     $id = new PollId();
     $data = array('pollId' => (string) $id, 'optionNumber' => 2);
     $event = OptionVotedEvent::deserialize($data);
     $this->assertSame($data, $event->serialize());
 }