[Solved] PHP UNIT TEST METHODS
Static calls are fixed dependencies and should be avoided. If you use dependency injection you can replace the dependencies with stubs and/or mocks. With that the DamageCalculator can be an interface as well and allow for different implementations. use PHPUnit\Framework\TestCase; interface HeroInterface { public function getAttack(): int; public function getDefence(): int; public function getHealthPoints(): int; … Read more