private function checkChosenPropertiesSum($primaryPropertiesSum, $secondaryPropertiesSum, ExceptionalityFate $fate, ProfessionLevel $professionLevel) { if ($primaryPropertiesSum !== $fate->getPrimaryPropertiesBonusOnChoice()) { throw new Exceptions\InvalidSumOfChosenProperties("Expected sum of primary properties is {$fate->getPrimaryPropertiesBonusOnChoice()}, got {$primaryPropertiesSum}" . " for profession {$professionLevel->getProfession()->getValue()} and fate {$fate::getCode()}"); } if ($secondaryPropertiesSum !== $fate->getSecondaryPropertiesBonusOnChoice()) { throw new Exceptions\InvalidSumOfChosenProperties("Expected sum of secondary properties is {$fate->getSecondaryPropertiesBonusOnChoice()}, got {$secondaryPropertiesSum}" . " for profession {$professionLevel->getProfession()->getValue()} and fate {$fate::getCode()}"); } }
/** * @param ExceptionalityFate $fate * * @test * @depends I_can_create_it_by_self */ public function I_can_get_properties_bonus_on_choice(ExceptionalityFate $fate) { self::assertSame($this->getExpectedPrimaryPropertiesBonusOnChoice(), $fate->getPrimaryPropertiesBonusOnChoice()); self::assertSame($this->getExpectedSecondaryPropertiesBonusOnChoice(), $fate->getSecondaryPropertiesBonusOnChoice()); }