@@ -64,14 +64,14 @@ protected function assertEloquentHasMany($class, $relation)
6464 $ this ->assertCollectionsEqual ($ children , $ parent ->{$ relation }, $ childKey );
6565 }
6666
67- protected function assertEloquentHasCreateRelationMethod ($ class , $ relation )
67+ protected function assertEloquentHasCreateRelationMethod ($ class , $ relation, $ createMethod = null )
6868 {
6969 $ this ->assertMethodExists ($ class , $ relation );
7070
7171 $ hasManyRelation = (new $ class )->{$ relation }();
7272 $ this ->assertInstanceOf (HasMany::class, $ hasManyRelation );
7373
74- $ createMethod = 'create ' . title_case (str_singular ($ relation ));
74+ $ createMethod = ! empty ( $ createMethod ) ? $ createMethod : 'create ' . title_case (str_singular ($ relation ));
7575 $ this ->assertMethodExists ($ class , $ createMethod );
7676
7777 $ parent = factory ($ class )->create ();
@@ -84,14 +84,14 @@ protected function assertEloquentHasCreateRelationMethod($class, $relation)
8484 $ this ->assertEquals ($ child ->fresh ()->toArray (), $ parent ->{$ relation }->first ()->toArray ());
8585 }
8686
87- protected function assertEloquentHasCreateManyRelationsMethod ($ class , $ relation )
87+ protected function assertEloquentHasCreateManyRelationsMethod ($ class , $ relation, $ createManyMethod = null )
8888 {
8989 $ this ->assertMethodExists ($ class , $ relation );
9090
9191 $ hasManyRelation = (new $ class )->{$ relation }();
9292 $ this ->assertInstanceOf (HasMany::class, $ hasManyRelation );
9393
94- $ createManyMethod = 'createMany ' . title_case ($ relation );
94+ $ createManyMethod = ! empty ( $ createManyMethod ) ? $ createManyMethod : 'createMany ' . title_case ($ relation );
9595 $ this ->assertMethodExists ($ class , $ createManyMethod );
9696
9797 $ childModel = $ hasManyRelation ->getRelated ();
0 commit comments