test that text is created

This commit is contained in:
Yisroel Baum 2026-02-19 20:59:49 +02:00
parent accfa9d04f
commit 29f93e6b0d
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -0,0 +1,25 @@
<?php
namespace Tests\Unit\Text\UseCases;
use App\Text\Text;
use App\Text\TextRepository;
use App\Text\UseCases\CreateText;
use App\Text\UseCases\CreateTextRequest;
use PHPUnit\Framework\TestCase;
use Tests\Fakes\FakeTextRepository;
class CreateTextTest extends TestCase
{
public function test_create_text(): void
{
$textRepo = new FakeTextRepository;
$useCase = new CreateText($textRepo);
$text = $useCase->execute(new CreateTextRequest(
name: 'test',
));
$this->assertInstanceOf(TextRepository::class, $textRepo);
$this->assertInstanceOf(Text::class, $text);
$this->assertEquals('test', $text->getName());
}
}