diff --git a/tests/BelongsToThroughTest.php b/tests/BelongsToThroughTest.php index bc6e855..d2e3f01 100644 --- a/tests/BelongsToThroughTest.php +++ b/tests/BelongsToThroughTest.php @@ -52,6 +52,14 @@ public function testEagerLoading() $this->assertNull($comments[2]->country); } + public function testEagerLoadingWithPrefix() + { + $comments = Comment::with('countryWithPrefix')->get(); + + $this->assertNull($comments[0]->countryWithPrefix); + $this->assertEquals(1, $comments[3]->countryWithPrefix->id); + } + public function testLazyEagerLoading() { $comments = Comment::all()->load('country');