test create plan with request

This commit is contained in:
Yisroel Baum 2026-02-23 10:41:31 +02:00
parent de744c9b15
commit 9f29b9b94e
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,21 @@
<?php
namespace Tests\Unit\Plan\UseCases;
use App\Plan\UseCases\CreatePlan;
use App\Plan\UseCases\CreatePlanRequest;
use Tests\Fakes\FakePlanRepository;
use PHPUnit\Framework\TestCase;
class CreatePlanTest extends TestCase
{
public function test_create_plan(): void
{
$planRepo = new FakePlanRepository;
$useCase = new CreatePlan($planRepo);
$plan = $useCase->execute(new CreatePlanRequest(
name: 'testPlan',
));
$this->assertEquals('testPlan', $plan->getName());
}
}