Skip to content

Commit 6c479d7

Browse files
committed
ITT: assertEloquentHasCreateRelationMethod renamed to assertEloquentHasCreateFor.
1 parent 8d3fba6 commit 6c479d7

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
@@ -97,7 +97,7 @@ Provides Laravel-specific testing helpers and asserts.
9797
- [assertEloquentTouchesEquals](#asserteloquenttouchesequals)
9898
- [assertEloquentTouchesNotEquals](#asserteloquenttouchesnotequals)
9999
- [assertEloquentHasMany](#asserteloquenthasmany)
100-
- [assertEloquentHasCreateRelationMethod](#asserteloquenthascreaterelationmethod)
100+
- [assertEloquentHasCreateFor](#asserteloquenthascreatefor)
101101
- [assertEloquentHasCreateManyRelationsMethod](#asserteloquenthascreatemanyrelationsmethod)
102102
- [assertEloquentBelongsTo](#asserteloquentbelongsto)
103103
- [ExceptionAsserts](#exceptionasserts)
@@ -423,14 +423,14 @@ class Post extends Model
423423
}
424424
```
425425

426-
#### `assertEloquentHasCreateRelationMethod()`
426+
#### `assertEloquentHasCreateFor()`
427427

428428
> NOTE: In order to use this assertion, you have to create model factories for both classes.
429429
430430
Checks if Eloquent model has `create` method for specified `HasMany` relation:
431431

432432
```php
433-
$this->assertEloquentHasCreateRelationMethod(Post::class, 'comments');
433+
$this->assertEloquentHasCreateFor(Post::class, 'comments');
434434
```
435435

436436
Assuming that `Post` class has `createComment` method:

src/Asserts/EloquentAsserts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function assertEloquentHasMany($class, $relation)
6464
$this->assertCollectionsEqual($children, $parent->{$relation}, $childKey);
6565
}
6666

67-
protected function assertEloquentHasCreateRelationMethod($class, $relation, $createMethod = null)
67+
protected function assertEloquentHasCreateFor($class, $relation, $createMethod = null)
6868
{
6969
$this->assertMethodExists($class, $relation);
7070

tests/TestingTools/Asserts/EloquentAssertsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ public function it_has_eloquent_has_many_assertion()
5151
}
5252

5353
/** @test */
54-
public function it_has_eloquent_has_create_relation_method_assertion()
54+
public function it_has_eloquent_has_create_for_assertion()
5555
{
56-
$this->assertEloquentHasCreateRelationMethod(Post::class, 'comments');
56+
$this->assertEloquentHasCreateFor(Post::class, 'comments');
5757
}
5858

5959
/** @test */
6060
public function which_supports_optional_parameter_for_specifying_custom_create_method_name()
6161
{
62-
$this->assertEloquentHasCreateRelationMethod(Post::class, 'comments', 'attachComment');
62+
$this->assertEloquentHasCreateFor(Post::class, 'comments', 'attachComment');
6363
}
6464

6565
/** @test */

0 commit comments

Comments
 (0)