File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
tests/Integration/CachedBuilder Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ public function testFindModelResultsCreatesCache()
3535
3636 public function testFindMultipleModelResultsCreatesCache ()
3737 {
38- $ authors = (new Author )->find ([1 , 2 , 3 ]);
38+ $ authors = (new Author )
39+ ->find ([1 , 2 , 3 ]);
3940 $ key = sha1 ('genealabs:laravel-model-caching:testing::memory::authors:genealabslaravelmodelcachingtestsfixturesauthor-find_list_1_2_3 ' );
4041 $ tags = [
4142 'genealabs:laravel-model-caching:testing::memory::genealabslaravelmodelcachingtestsfixturesauthor ' ,
@@ -69,4 +70,16 @@ public function testFindWithArrayReturnsResults()
6970 $ this ->assertEquals ($ uncachedAuthor ->count (), $ author ->count ());
7071 $ this ->assertEquals ($ uncachedAuthor ->pluck ("id " ), $ author ->pluck ("id " ));
7172 }
73+
74+ public function testFindWithSingleElementArrayDoesntConflictWithNormalFind ()
75+ {
76+ $ author1 = (new Author )
77+ ->find (1 );
78+ $ author2 = (new Author )
79+ ->find ([1 ]);
80+
81+ $ this ->assertNotEquals ($ author1 , $ author2 );
82+ $ this ->assertIsIterable ($ author2 );
83+ $ this ->assertEquals (Author::class, get_class ($ author1 ));
84+ }
7285}
You can’t perform that action at this time.
0 commit comments