/** * @dataProvider gamePlayerProvider */ public function testRemovePlayers(PlayerInterface $player) { $game = new Game(); $game->addPlayer($player); $game->removePlayer(1); $this->assertSame([], $game->getPlayers()); }
/** * 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); }
/** * Train Player. * * @param int $number Player number. */ public function trainPlayer($number = 1) { $this->game->getPlayer($number)->train(); }