/** * @test * @expectedException \DrdPlus\Skills\Combined\Exceptions\CombinedSkillsDoNotHowToUseThatWeapon * @expectedExceptionMessageRegExp ~notBowNorCrossbowYouKnow~ */ public function I_can_not_get_malus_for_weapon_not_affected_by_combined_skill() { $combinedSkills = new CombinedSkills(); /** @var MissingWeaponSkillTable $missingWeaponSkillsTable */ $missingWeaponSkillsTable = $this->mockery(MissingWeaponSkillTable::class); $combinedSkills->getMalusToFightNumberWithShootingWeapon($this->createRangeWeaponCode('notBowNorCrossbowYouKnow'), $missingWeaponSkillsTable); }
private static function createCombinedSkillEntities(Tables $tables, ProfessionFirstLevel $firstLevel) { $combinedSkillClasses = self::getListOfSkillClasses(CombinedSkill::class); $combinedSkillPoint = CombinedSkillPoint::createFromFirstLevelBackgroundSkillPoints($firstLevel, BackgroundSkillPoints::getIt(3, Heritage::getIt(5)), $tables); $requiredRankValue = new PositiveIntegerObject(1); $combinedSkillList = array_map(function ($combinedSkillClass) use($firstLevel, $combinedSkillPoint, $requiredRankValue) { /** @var CombinedSkill $combinedSkill */ $combinedSkill = new $combinedSkillClass($firstLevel); $combinedSkill->addSkillRank($combinedSkillPoint); return $combinedSkill; }, $combinedSkillClasses); $combinedSkills = new CombinedSkills(); foreach ($combinedSkillList as $combinedSkill) { $combinedSkills->addCombinedSkill($combinedSkill); } $combinedSkillPoint = CombinedSkillPoint::createFromFirstLevelBackgroundSkillPoints($firstLevel, BackgroundSkillPoints::getIt(3, Heritage::getIt(5)), $tables); $combinedSkillRank = new CombinedSkillRank(new Cooking($firstLevel), CombinedSkillPoint::createFromFirstLevelBackgroundSkillPoints($firstLevel, BackgroundSkillPoints::getIt(4, Heritage::getIt(5)), $tables), new PositiveIntegerObject(1)); return array_merge($combinedSkillList, [$combinedSkills, $combinedSkillPoint, $combinedSkillRank]); }