test create plan with request
This commit is contained in:
parent
de744c9b15
commit
9f29b9b94e
3 changed files with 52 additions and 0 deletions
21
tests/Unit/Plan/UseCases/CreatePlanTest.php
Normal file
21
tests/Unit/Plan/UseCases/CreatePlanTest.php
Normal 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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue