File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -504,8 +504,20 @@ public function testNestedRelationshipWhereClauseParsing()
504504
505505 public function testExistsRelationshipWhereClauseParsing ()
506506 {
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+
509521 }
510522
511523 public function testColumnsRelationshipWhereClauseParsing ()
You can’t perform that action at this time.
0 commit comments