コード例 #1
0
ファイル: PlayerTest.php プロジェクト: kosak83/OpenSoccerStar
 public function testSetAndGetTrainingValueOffense()
 {
     $this->player->setTrainingValueOffense(50);
     $this->assertEquals(50, $this->player->getTrainingValueOffense());
 }
コード例 #2
0
ファイル: TeamTest.php プロジェクト: kosak83/OpenSoccerStar
 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());
 }
コード例 #3
0
 /**
  * @param int $trainingValueDefense
  * @param int $trainingValueOffense
  */
 private function setUpPlayer($trainingValueDefense, $trainingValueOffense)
 {
     $this->player = new Player();
     $this->player->setTrainingValueDefense($trainingValueDefense);
     $this->player->setTrainingValueOffense($trainingValueOffense);
 }