Esempio n. 1
0
 /**
  * @dataProvider gamePlayerProvider
  */
 public function testRemovePlayers(PlayerInterface $player)
 {
     $game = new Game();
     $game->addPlayer($player);
     $game->removePlayer(1);
     $this->assertSame([], $game->getPlayers());
 }
Esempio n. 2
0
 /**
  * Test removePlayer removes the player.
  *
  * @dataProvider gamePlayerProvider
  */
 public function testRemovePlayer(PlayerInterface $player)
 {
     $game = new Game();
     $game->addPlayer($player);
     $game->addPlayer($player);
     $game->removePlayer(1);
     $players = [$player, $player];
     unset($players[0]);
     $result = $game->getPlayers();
     $this->assertSame($players, $result);
 }
Esempio n. 3
0
 /**
  * Train Player.
  * 
  * @param int $number Player number.
  */
 public function trainPlayer($number = 1)
 {
     $this->game->getPlayer($number)->train();
 }