예제 #1
0
파일: Option.php 프로젝트: cdspuglia/pollo
 /**
  * @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());
 }