update text controller test with node repo
This commit is contained in:
parent
d4f5b22034
commit
9b24fddec1
1 changed files with 6 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ use App\Text\UseCases\CreateText;
|
|||
use PHPUnit\Framework\TestCase;
|
||||
use Slim\Psr7\Factory\ServerRequestFactory;
|
||||
use Slim\Psr7\Response;
|
||||
use Tests\Fakes\FakeNodeRepository;
|
||||
use Tests\Fakes\FakeTextRepository;
|
||||
|
||||
class TextControllerTest extends TestCase
|
||||
|
|
@ -22,7 +23,7 @@ class TextControllerTest extends TestCase
|
|||
$this->textRepo->create(new CreateTextDto(
|
||||
name: 'test text',
|
||||
));
|
||||
$this->controller = new TextController($this->textRepo);
|
||||
$this->controller = new TextController($this->textRepo, new FakeNodeRepository);
|
||||
}
|
||||
|
||||
public function test_get_one_text(): void
|
||||
|
|
@ -70,7 +71,10 @@ class TextControllerTest extends TestCase
|
|||
$response = $this->controller->createText(
|
||||
$request,
|
||||
new Response(),
|
||||
new CreateText($this->textRepo),
|
||||
new CreateText(
|
||||
$this->textRepo,
|
||||
new FakeNodeRepository,
|
||||
),
|
||||
);
|
||||
$this->assertEquals(
|
||||
json_encode([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue