File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -504,8 +504,20 @@ public function testNestedRelationshipWhereClauseParsing()
504
504
505
505
public function testExistsRelationshipWhereClauseParsing ()
506
506
{
507
- // ->whereHas(...)
508
- $ this ->markTestIncomplete ();
507
+
508
+ $ authors = collect ([(new Author )->whereHas ('books ' )->first ()]);
509
+
510
+ $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_authors.id_=_books.author_id-first ' ;
511
+ $ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
512
+
513
+ $ cachedResults = collect ([cache ()->tags ($ tags )->get ($ key )]);
514
+
515
+ $ liveResults = collect ([(new UncachedAuthor )
516
+ ->whereHas ('books ' )->first ()]);
517
+
518
+ $ this ->assertTrue ($ authors ->diffAssoc ($ cachedResults )->isEmpty ());
519
+ $ this ->assertTrue ($ liveResults ->diffAssoc ($ cachedResults )->isEmpty ());
520
+
509
521
}
510
522
511
523
public function testColumnsRelationshipWhereClauseParsing ()
You can’t perform that action at this time.
0 commit comments