File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,24 @@ public function it_has_eloquent_has_create_relation_method_assertion()
5656 $ this ->assertEloquentHasCreateRelationMethod (Post::class, 'comments ' );
5757 }
5858
59+ /** @test */
60+ public function which_supports_optional_parameter_for_specifying_custom_create_method_name ()
61+ {
62+ $ this ->assertEloquentHasCreateRelationMethod (Post::class, 'comments ' , 'attachComment ' );
63+ }
64+
5965 /** @test */
6066 public function it_has_eloquent_has_create_many_relations_method_assertion ()
6167 {
6268 $ this ->assertEloquentHasCreateManyRelationsMethod (Post::class, 'comments ' );
6369 }
6470
71+ /** @test */
72+ public function which_also_supports_optional_parameter_for_specifying_custom_create_many_method_name ()
73+ {
74+ $ this ->assertEloquentHasCreateManyRelationsMethod (Post::class, 'comments ' , 'attachManyComments ' );
75+ }
76+
6577 /** @test */
6678 public function it_has_eloquent_belongs_to_assertion ()
6779 {
Original file line number Diff line number Diff line change @@ -23,4 +23,14 @@ public function createManyComments(array $comments)
2323 {
2424 return $ this ->comments ()->createMany ($ comments );
2525 }
26+
27+ public function attachComment (array $ attributes )
28+ {
29+ return $ this ->createComment ($ attributes );
30+ }
31+
32+ public function attachManyComments (array $ comments )
33+ {
34+ return $ this ->createManyComments ($ comments );
35+ }
2636}
You can’t perform that action at this time.
0 commit comments