Example #1
0
 /**
  * @test
  */
 public function testDomainMethods()
 {
     $id = $this->getPlayerId(42);
     $name = 'Douglas';
     $lives = 5;
     $game = \Mockery::mock('\\Hangman\\Entity\\Hangman');
     $game->shouldReceive('getId')->andReturn($this->getMiniGameId(33));
     $a = 'a';
     $b = 'b';
     $player = new HangmanPlayer($id, $name, $lives, $game);
     $player->loseLife();
     $this->assertEquals(--$lives, $player->getRemainingLives());
     $player->playLetter($a);
     $this->assertEquals(array('A' => 'A'), $player->getPlayedLetters());
     $player->playLetter($a);
     $this->assertEquals(array('A' => 'A'), $player->getPlayedLetters());
     $player->playLetter($b);
     $this->assertEquals(array('A' => 'A', 'B' => 'B'), $player->getPlayedLetters());
 }