/**
  * @test
  */
 public function testHangmanCreated()
 {
     $id = $this->getMiniGameId(666);
     $word = 'TEST';
     $event = new HangmanGameCreatedEvent($id, $word);
     $this->assertEquals($id, $event->getGameId());
     $this->assertEquals($word, $event->getWord());
 }
Ejemplo n.º 2
0
 /**
  * Apply the game created event
  *
  * @param  HangmanGameCreatedEvent $event
  * @return void
  */
 protected function applyHangmanGameCreatedEvent(HangmanGameCreatedEvent $event)
 {
     $this->id = $event->getGameId();
     $this->word = strtoupper($event->getWord());
     $this->players = [];
     $this->gameOrder = [];
     $this->state = self::STATE_READY;
 }