Skip to content

Commit f09de15

Browse files
committed
ITT: assertEloquentHasCreateManyRelationsMethod renamed to assertEloquentHasCreateManyFor.
1 parent 6c479d7 commit f09de15

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Provides Laravel-specific testing helpers and asserts.
9898
- [assertEloquentTouchesNotEquals](#asserteloquenttouchesnotequals)
9999
- [assertEloquentHasMany](#asserteloquenthasmany)
100100
- [assertEloquentHasCreateFor](#asserteloquenthascreatefor)
101-
- [assertEloquentHasCreateManyRelationsMethod](#asserteloquenthascreatemanyrelationsmethod)
101+
- [assertEloquentHasCreateManyFor](#asserteloquenthascreatemanyfor)
102102
- [assertEloquentBelongsTo](#asserteloquentbelongsto)
103103
- [ExceptionAsserts](#exceptionasserts)
104104
- [willSeeException](#willseeexception)
@@ -445,14 +445,14 @@ class Post extends Model
445445
}
446446
```
447447

448-
#### `assertEloquentHasCreateManyRelationsMethod()`
448+
#### `assertEloquentHasCreateManyFor()`
449449

450450
> NOTE: In order to use this assertion, you have to create model factories for both classes.
451451
452452
Checks if Eloquent model has `createMany` method for specified `HasMany` relation:
453453

454454
```php
455-
$this->assertEloquentHasCreateManyRelationsMethod(Post::class, 'comments');
455+
$this->assertEloquentHasCreateManyFor(Post::class, 'comments');
456456
```
457457

458458
Assuming that `Post` class has `createManyComments` method:

src/Asserts/EloquentAsserts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function assertEloquentHasCreateFor($class, $relation, $createMethod =
8484
$this->assertEquals($child->fresh()->toArray(), $parent->{$relation}->first()->toArray());
8585
}
8686

87-
protected function assertEloquentHasCreateManyRelationsMethod($class, $relation, $createManyMethod = null)
87+
protected function assertEloquentHasCreateManyFor($class, $relation, $createManyMethod = null)
8888
{
8989
$this->assertMethodExists($class, $relation);
9090

tests/TestingTools/Asserts/EloquentAssertsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ public function which_supports_optional_parameter_for_specifying_custom_create_m
6363
}
6464

6565
/** @test */
66-
public function it_has_eloquent_has_create_many_relations_method_assertion()
66+
public function it_has_eloquent_has_create_many_for_assertion()
6767
{
68-
$this->assertEloquentHasCreateManyRelationsMethod(Post::class, 'comments');
68+
$this->assertEloquentHasCreateManyFor(Post::class, 'comments');
6969
}
7070

7171
/** @test */
7272
public function which_also_supports_optional_parameter_for_specifying_custom_create_many_method_name()
7373
{
74-
$this->assertEloquentHasCreateManyRelationsMethod(Post::class, 'comments', 'attachManyComments');
74+
$this->assertEloquentHasCreateManyFor(Post::class, 'comments', 'attachManyComments');
7575
}
7676

7777
/** @test */

0 commit comments

Comments
 (0)