We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98f53e1 commit 2923ea5Copy full SHA for 2923ea5
tests/Unit/CachedBuilderTest.php
@@ -438,4 +438,19 @@ public function testNestedRelationshipEagerloading()
438
$this->assertEmpty($authors->diffAssoc($cachedResults));
439
$this->assertEmpty($liveResults->diffAssoc($cachedResults));
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
+ }
456
0 commit comments