Skip to content

Commit 60ae6ac

Browse files
committed
Merge branch 'master' into develop
2 parents ad573d1 + 44fccfc commit 60ae6ac

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Integration/CachedBuilderTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,4 +929,21 @@ public function testUpdateInvalidatesCache()
929929
$this->assertEquals("Updated Name", $authorAfterUpdate->name);
930930
$this->assertEquals($authorAfterUpdate->name, $uncachedAuthor->name);
931931
}
932+
933+
public function testAccessingGetResultsViaArrayIndexDoesNotError()
934+
{
935+
$author = (new Author)
936+
->where('id', 1)
937+
->get()[0];
938+
$cachedAuthor = (new Author)
939+
->where('id', 1)
940+
->get()[0];
941+
$uncachedAuthor = (new UncachedAuthor)
942+
->where('id', 1)
943+
->get()[0];
944+
945+
$this->assertEquals(1, $author->id);
946+
$this->assertEquals($author, $cachedAuthor);
947+
$this->assertEquals($author->toArray(), $uncachedAuthor->toArray());
948+
}
932949
}

0 commit comments

Comments
 (0)