/** * @param OptionVotedEvent $event */ protected function applyOptionVotedEvent(OptionVotedEvent $event) { $number = $event->getOptionNumber(); if ($number === $this->number) { $this->votes++; } }
/** * @test * @group unit */ public function get_option_number_returns_correct_value() { $id = new PollId(); $event = new OptionVotedEvent($id, 2); $this->assertEquals(2, $event->getOptionNumber()); }