Example #1
0
 public function testTrainByOffensiveTrainerWithSkill100()
 {
     $this->setUpPlayer(0, 0);
     $this->setUpTrainer(100, Trainer::PREFERRED_TRAINING_OFFENSIVE);
     $this->trainer->train($this->player);
     $this->assertEquals(25, $this->player->getTrainingValueDefense());
     $this->assertEquals(75, $this->player->getTrainingValueOffense());
 }
Example #2
0
 public function testUpdateSkill()
 {
     $this->setUpPlayer(20, 50, 100, -100);
     $this->player->updateSkills();
     $this->assertGreaterThanOrEqual(20, $this->player->getSkillDefense());
     $this->assertLessThanOrEqual(30, $this->player->getSkillDefense());
     $this->assertEquals(0, $this->player->getTrainingValueDefense());
     $this->assertGreaterThanOrEqual(0, $this->player->getSkillChangeDefense());
     $this->assertLessThanOrEqual(10, $this->player->getSkillChangeDefense());
     $this->assertGreaterThanOrEqual(40, $this->player->getSkillOffense());
     $this->assertLessThanOrEqual(50, $this->player->getSkillOffense());
     $this->assertEquals(0, $this->player->getTrainingValueOffense());
     $this->assertGreaterThanOrEqual(-10, $this->player->getSkillChangeOffense());
     $this->assertLessThanOrEqual(0, $this->player->getSkillChangeOffense());
 }