public function testSetAndGetTrainingValueOffense() { $this->player->setTrainingValueOffense(50); $this->assertEquals(50, $this->player->getTrainingValueOffense()); }
public function testHandleTraining() { $this->team->setTrainer(new Trainer()); $this->team->addPlayer(new Player()); $player = new Player(); $player->setTrainingValueDefense(10); $player->setTrainingValueOffense(10); $this->team->addPlayer($player); $this->team->train(); $players = $this->team->getPlayers(); $this->assertEquals(1, $players[0]->getTrainingValueDefense()); $this->assertEquals(1, $players[0]->getTrainingValueOffense()); $this->assertEquals(11, $players[1]->getTrainingValueDefense()); $this->assertEquals(11, $players[1]->getTrainingValueOffense()); }
/** * @param int $trainingValueDefense * @param int $trainingValueOffense */ private function setUpPlayer($trainingValueDefense, $trainingValueOffense) { $this->player = new Player(); $this->player->setTrainingValueDefense($trainingValueDefense); $this->player->setTrainingValueOffense($trainingValueOffense); }