implement ListCommentsForPost use case
Renames seed() helper to seedComment() to avoid clashing with Illuminate\Foundation\Testing\TestCase::seed().
This commit is contained in:
parent
f9e2529994
commit
a59fc4890f
3 changed files with 42 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ class ListCommentsForPostTest extends TestCase
|
|||
$this->useCase = new ListCommentsForPost($this->commentRepo);
|
||||
}
|
||||
|
||||
private function seed(int $postId, string $body, string $offset): void
|
||||
private function seedComment(int $postId, string $body, string $offset): void
|
||||
{
|
||||
$this->commentRepo->create(new CreateCommentDto(
|
||||
postId: $postId,
|
||||
|
|
@ -58,9 +58,9 @@ class ListCommentsForPostTest extends TestCase
|
|||
|
||||
public function test_returns_only_comments_for_given_post(): void
|
||||
{
|
||||
$this->seed(1, 'first', '+0 seconds');
|
||||
$this->seed(2, 'other-post', '+0 seconds');
|
||||
$this->seed(1, 'second', '+1 minute');
|
||||
$this->seedComment(1, 'first', '+0 seconds');
|
||||
$this->seedComment(2, 'other-post', '+0 seconds');
|
||||
$this->seedComment(1, 'second', '+1 minute');
|
||||
|
||||
$result = $this->useCase->execute(new ListCommentsForPostRequest(
|
||||
postId: 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue