Goal-Calibration/tests/Unit/Plan/UseCases/CreatePlanTest.php

21 lines
535 B
PHP

<?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());
}
}