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()
35
35
36
36
public function testFindMultipleModelResultsCreatesCache ()
37
37
{
38
- $ authors = (new Author )->find ([1 , 2 , 3 ]);
38
+ $ authors = (new Author )
39
+ ->find ([1 , 2 , 3 ]);
39
40
$ key = sha1 ('genealabs:laravel-model-caching:testing::memory::authors:genealabslaravelmodelcachingtestsfixturesauthor-find_list_1_2_3 ' );
40
41
$ tags = [
41
42
'genealabs:laravel-model-caching:testing::memory::genealabslaravelmodelcachingtestsfixturesauthor ' ,
@@ -69,4 +70,16 @@ public function testFindWithArrayReturnsResults()
69
70
$ this ->assertEquals ($ uncachedAuthor ->count (), $ author ->count ());
70
71
$ this ->assertEquals ($ uncachedAuthor ->pluck ("id " ), $ author ->pluck ("id " ));
71
72
}
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
+ }
72
85
}
You can’t perform that action at this time.
0 commit comments