diff --git a/tests/Unit/Plan/UseCases/CreatePlanTest.php b/tests/Unit/Plan/UseCases/CreatePlanTest.php index 095a64c..ce2c48e 100644 --- a/tests/Unit/Plan/UseCases/CreatePlanTest.php +++ b/tests/Unit/Plan/UseCases/CreatePlanTest.php @@ -9,11 +9,18 @@ use PHPUnit\Framework\TestCase; class CreatePlanTest extends TestCase { + private FakePlanRepository $planRepo; + private CreatePlan $useCase; + + public function setUp(): void + { + $this->planRepo = new FakePlanRepository; + $this->useCase = new CreatePlan($this->planRepo); + } + public function test_create_plan(): void { - $planRepo = new FakePlanRepository; - $useCase = new CreatePlan($planRepo); - $plan = $useCase->execute(new CreatePlanRequest( + $plan = $this->useCase->execute(new CreatePlanRequest( name: 'testPlan', )); $this->assertEquals('testPlan', $plan->getName());