test that text is created
This commit is contained in:
parent
accfa9d04f
commit
29f93e6b0d
1 changed files with 25 additions and 0 deletions
25
tests/Unit/Text/UseCases/CreateTextTest.php
Normal file
25
tests/Unit/Text/UseCases/CreateTextTest.php
Normal 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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue