/** * @test * @dataProvider provideBodySizeAndStrength * @param int $requiredStrength * @param int $bodySize * @param int $strength * @param mixed $expectedMissingStrength */ public function I_can_get_missing_strength_and_sanction_values_for_body_armor_and_helm($requiredStrength, $bodySize, $strength, $expectedMissingStrength) { $armourer = new Armourer($tables = $this->createTables()); $bodyArmorCode = $this->createBodyArmorCode('foo'); $tables->shouldReceive('getArmamentsTableByArmamentCode')->with($bodyArmorCode)->andReturn($armamentsTable = $this->mockery(AbstractArmamentsTable::class)); $armamentsTable->shouldReceive('getRequiredStrengthOf')->with($bodyArmorCode)->andReturn($requiredStrength); self::assertSame($expectedMissingStrength, $armourer->getMissingStrengthForArmament($bodyArmorCode, Strength::getIt($strength), Size::getIt($bodySize))); $helmCode = $this->createHelmCode('bar'); $tables->shouldReceive('getArmamentsTableByArmamentCode')->with($helmCode)->andReturn($armamentsTable = $this->mockery(AbstractArmamentsTable::class)); $armamentsTable->shouldReceive('getRequiredStrengthOf')->with($helmCode)->andReturn($requiredStrength); self::assertSame($expectedMissingStrength, $armourer->getMissingStrengthForArmament($helmCode, Strength::getIt($strength), Size::getIt($bodySize))); $tables->shouldReceive('getArmorStrengthSanctionsTable')->andReturn($armorSanctionsTable = $this->createArmorSanctionsTable()); $armorSanctionsTable->shouldReceive('getSanctionDescription')->with($expectedMissingStrength)->andReturn('qux'); self::assertSame('qux', $armourer->getSanctionDescriptionByStrengthWithArmor($helmCode, Strength::getIt($strength), Size::getIt($bodySize))); $armorSanctionsTable->shouldReceive('getAgilityMalus')->with($expectedMissingStrength)->andReturn('qux'); self::assertSame('qux', $armourer->getAgilityMalusByStrengthWithArmor($bodyArmorCode, Strength::getIt($strength), Size::getIt($bodySize))); }