/**
  * @test
  */
 public function testGoodLetterProposed()
 {
     $gameId = $this->getMiniGameId(666);
     $playerId = $this->getPlayerId(42);
     $letter = 'A';
     $playedLetters = array('A');
     $remainingLives = 5;
     $wordSoFar = 'A _ _';
     $event = new HangmanGoodLetterProposedEvent($gameId, $playerId, $letter, $playedLetters, $remainingLives, $wordSoFar);
     $this->assertEquals($gameId, $event->getGameId());
     $this->assertEquals($playerId, $event->getPlayerId());
     $this->assertEquals($letter, $event->getLetter());
     $this->assertEquals($playedLetters, $event->getPlayedLetters());
     $this->assertEquals($remainingLives, $event->getRemainingLives());
     $this->assertEquals($wordSoFar, $event->getWordSoFar());
     $this->assertEquals($wordSoFar, $event->getFeedback());
 }
Пример #2
0
 /**
  * Apply the bad letter played event
  *
  * @param  HangmanGoodLetterProposedEvent $event
  * @return void
  */
 protected function applyHangmanGoodLetterProposedEvent(HangmanGoodLetterProposedEvent $event)
 {
     if ((string) $event->getPlayerId() === (string) $this->getId()) {
         $this->playLetter($event->getLetter());
     }
 }