Skip to content

Commit 7c7955e

Browse files
committed
ITT: assertEloquentBelongsTo tests added.
1 parent 7624e83 commit 7c7955e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/TestingTools/Asserts/EloquentAssertsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminated\Testing\TestingTools\Tests\Asserts;
44

5+
use Comment;
56
use Illuminated\Testing\TestingTools\Tests\TestCase;
67
use Post;
78

@@ -54,4 +55,10 @@ public function it_has_eloquent_has_create_relation_method_assertion()
5455
{
5556
$this->assertEloquentHasCreateRelationMethod(Post::class, 'comments');
5657
}
58+
59+
/** @test */
60+
public function it_has_eloquent_belongs_to_assertion()
61+
{
62+
$this->assertEloquentBelongsTo(Comment::class, 'post');
63+
}
5764
}

tests/TestingTools/fixture/app/Comment.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ class Comment extends Model
66
{
77
protected $table = 'comments';
88
protected $fillable = ['body'];
9+
10+
public function post()
11+
{
12+
return $this->belongsTo(Post::class);
13+
}
914
}

0 commit comments

Comments
 (0)