@@ -98,6 +98,7 @@ Provides Laravel-specific testing helpers and asserts.
9898 - [assertEloquentTouchesNotEquals](#asserteloquenttouchesnotequals)
9999 - [assertEloquentHasMany](#asserteloquenthasmany)
100100 - [assertEloquentHasCreateRelationMethod](#asserteloquenthascreaterelationmethod)
101+ - [assertEloquentHasCreateManyRelationsMethod](#asserteloquenthascreatemanyrelationsmethod)
101102 - [assertEloquentBelongsTo](#asserteloquentbelongsto)
102103- [ExceptionAsserts](#exceptionasserts)
103104 - [willSeeException](#willseeexception)
@@ -426,7 +427,7 @@ class Post extends Model
426427
427428> NOTE: In order to use this assertion, you have to create model factories for both classes.
428429
429- Checks if Eloquent model has create method for specified ` HasMany ` relation:
430+ Checks if Eloquent model has ` create ` method for specified ` HasMany ` relation:
430431
431432``` php
432433$this->assertEloquentHasCreateRelationMethod(Post::class, 'comments');
@@ -444,6 +445,28 @@ class Post extends Model
444445}
445446```
446447
448+ #### ` assertEloquentHasCreateManyRelationsMethod() `
449+
450+ > NOTE: In order to use this assertion, you have to create model factories for both classes.
451+
452+ Checks if Eloquent model has ` createMany ` method for specified ` HasMany ` relation:
453+
454+ ``` php
455+ $this->assertEloquentHasCreateManyRelationsMethod(Post::class, 'comments');
456+ ```
457+
458+ Assuming that ` Post ` class has ` createManyComments ` method:
459+
460+ ``` php
461+ class Post extends Model
462+ {
463+ public function createManyComments(array $comments)
464+ {
465+ return $this->comments()->createMany($comments);
466+ }
467+ }
468+ ```
469+
447470#### ` assertEloquentBelongsTo() `
448471
449472> NOTE: In order to use this assertion, you have to create model factories for both classes.
0 commit comments