Skip to content

Commit 8a0cac9

Browse files
committed
ITT: assertEloquentHasCreateRelationMethod tests added.
1 parent 9ddcc30 commit 8a0cac9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/TestingTools/Asserts/EloquentAssertsTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,10 @@ public function it_has_eloquent_has_many_assertion()
4848
{
4949
$this->assertEloquentHasMany(Post::class, 'comments');
5050
}
51+
52+
/** @test */
53+
public function it_has_eloquent_has_create_relation_method_assertion()
54+
{
55+
$this->assertEloquentHasCreateRelationMethod(Post::class, 'comments');
56+
}
5157
}

tests/TestingTools/fixture/app/Post.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ public function comments()
1313
{
1414
return $this->hasMany(Comment::class);
1515
}
16+
17+
public function createComment(array $comment)
18+
{
19+
return $this->comments()->create($comment);
20+
}
1621
}

0 commit comments

Comments
 (0)