File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -438,4 +438,19 @@ public function testNestedRelationshipEagerloading()
438
438
$ this ->assertEmpty ($ authors ->diffAssoc ($ cachedResults ));
439
439
$ this ->assertEmpty ($ liveResults ->diffAssoc ($ cachedResults ));
440
440
}
441
+
442
+ public function testNonEagerloadedRelationshipResolvesThroughCachedBuilder ()
443
+ {
444
+ $ books = (new Author )->first ()->books ;
445
+ $ key = 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_ ' ;
446
+ $ tags = [
447
+ 'genealabslaravelmodelcachingtestsfixturesbook ' ,
448
+ ];
449
+
450
+ $ cachedResults = cache ()->tags ($ tags )->get ($ key );
451
+ $ liveResults = (new UncachedAuthor )->first ()->books ;
452
+
453
+ $ this ->assertEmpty ($ books ->diffAssoc ($ cachedResults ));
454
+ $ this ->assertEmpty ($ liveResults ->diffAssoc ($ cachedResults ));
455
+ }
441
456
}
You can’t perform that action at this time.
0 commit comments