@@ -504,34 +504,38 @@ public function testNestedRelationshipWhereClauseParsing()
504
504
505
505
public function testExistsRelationshipWhereClauseParsing ()
506
506
{
507
+ $ authors = (new Author )->whereHas ('books ' )
508
+ ->get ();
507
509
508
- $ authors = collect ([(new Author )->whereHas ('books ' )->first ()]);
509
-
510
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_authors.id_=_books.author_id-first ' ;
510
+ $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_authors.id_=_books.author_id ' ;
511
511
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
512
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 ());
513
+ $ cachedResults = cache ()->tags ($ tags )->get ($ key );
514
+ $ liveResults = (new UncachedAuthor )->whereHas ('books ' )
515
+ ->get ();
520
516
517
+ $ this ->assertEmpty ($ authors ->diffAssoc ($ cachedResults ));
518
+ $ this ->assertEmpty ($ liveResults ->diffAssoc ($ cachedResults ));
521
519
}
522
520
523
521
public function testColumnsRelationshipWhereClauseParsing ()
524
522
{
525
- $ author = (new Author )->orderBy ('name ' )->first ();
526
-
527
- $ authors = collect ([(new Author )->where ('name ' , '= ' , $ author ->name )->first ()]);
528
-
529
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-name_ ' . $ author ->name . '-first ' ;
523
+ $ author = (new Author )
524
+ ->orderBy ('name ' )
525
+ ->first ();
526
+ $ authors = (new Author )
527
+ ->where ('name ' , '= ' , $ author ->name )
528
+ ->get ();
529
+ $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-name_ ' .
530
+ $ author ->name ;
530
531
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
531
532
532
- $ cachedResults = collect ([cache ()->tags ($ tags )->get ($ key )]);
533
-
534
- $ liveResults = collect ([(new UncachedAuthor )->where ('name ' , '= ' , $ author ->name )->first ()]);
533
+ $ cachedResults = cache ()
534
+ ->tags ($ tags )
535
+ ->get ($ key );
536
+ $ liveResults = (new UncachedAuthor )
537
+ ->where ('name ' , '= ' , $ author ->name )
538
+ ->get ();
535
539
536
540
$ this ->assertEmpty ($ authors ->diffAssoc ($ cachedResults ));
537
541
$ this ->assertEmpty ($ liveResults ->diffAssoc ($ cachedResults ));
0 commit comments