| Total Complexity | 6 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | final class StaticSuccessCalculatorTest extends \Tester\TestCase |
||
| 15 | { |
||
| 16 | private StaticSuccessCalculator $calculator; |
||
| 17 | |||
| 18 | protected function setUp(): void |
||
| 19 | { |
||
| 20 | $this->calculator = new StaticSuccessCalculator(); |
||
| 21 | } |
||
| 22 | |||
| 23 | private function generateCharacter(int $id): Character |
||
| 24 | { |
||
| 25 | $stats = [ |
||
| 26 | "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
||
| 27 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
||
| 28 | ]; |
||
| 29 | return new Character($stats); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function testHasHit(): void |
||
| 33 | { |
||
| 34 | $character1 = $this->generateCharacter(1); |
||
| 35 | $character2 = $this->generateCharacter(2); |
||
| 36 | for ($i = 1; $i <= 10; $i++) { |
||
| 37 | Assert::true($this->calculator->hasHit($character1, $character2)); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | public function testHasHealed(): void |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 52 |