diff --git a/tests/Unit/CachedBuilderTest.php b/tests/Unit/CachedBuilderTest.php index 1b9983a..66d275a 100644 --- a/tests/Unit/CachedBuilderTest.php +++ b/tests/Unit/CachedBuilderTest.php @@ -504,8 +504,20 @@ public function testNestedRelationshipWhereClauseParsing() public function testExistsRelationshipWhereClauseParsing() { - // ->whereHas(...) - $this->markTestIncomplete(); + + $authors = collect([(new Author)->whereHas('books')->first()]); + + $key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_authors.id_=_books.author_id-first'; + $tags = ['genealabslaravelmodelcachingtestsfixturesauthor']; + + $cachedResults = collect([cache()->tags($tags)->get($key)]); + + $liveResults = collect([(new UncachedAuthor) + ->whereHas('books')->first()]); + + $this->assertTrue($authors->diffAssoc($cachedResults)->isEmpty()); + $this->assertTrue($liveResults->diffAssoc($cachedResults)->isEmpty()); + } public function testColumnsRelationshipWhereClauseParsing()