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.
2 parents ad573d1 + 44fccfc commit 60ae6acCopy full SHA for 60ae6ac
tests/Integration/CachedBuilderTest.php
@@ -929,4 +929,21 @@ public function testUpdateInvalidatesCache()
929
$this->assertEquals("Updated Name", $authorAfterUpdate->name);
930
$this->assertEquals($authorAfterUpdate->name, $uncachedAuthor->name);
931
}
932
+
933
+ public function testAccessingGetResultsViaArrayIndexDoesNotError()
934
+ {
935
+ $author = (new Author)
936
+ ->where('id', 1)
937
+ ->get()[0];
938
+ $cachedAuthor = (new Author)
939
940
941
+ $uncachedAuthor = (new UncachedAuthor)
942
943
944
945
+ $this->assertEquals(1, $author->id);
946
+ $this->assertEquals($author, $cachedAuthor);
947
+ $this->assertEquals($author->toArray(), $uncachedAuthor->toArray());
948
+ }
949
0 commit comments