File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ protected function fetchIdentities(array $data): array
7575 ? array_column ($ data , 'id ' )
7676 : array_column ($ data ['data ' ], 'id ' );
7777
78+ if ($ userIds === []) {
79+ return $ data ;
80+ }
81+
7882 /** @var UserIdentityModel $identityModel */
7983 $ identityModel = model (UserIdentityModel::class);
8084
Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ public function testModelFindAllWithIdentities(): void
6969 $ this ->assertCount (2 , $ identities );
7070 }
7171
72+ public function testModelFindAllWithIdentitiesUserNotExists (): void
73+ {
74+ $ users = model (UserModel::class)->where ('active ' , 0 )->withIdentities ()->findAll ();
75+
76+ $ this ->assertSame ([], $ users );
77+ }
78+
7279 public function testModelFindByIdWithIdentities (): void
7380 {
7481 fake (UserModel::class);
@@ -81,6 +88,13 @@ public function testModelFindByIdWithIdentities(): void
8188 $ this ->assertCount (2 , $ user ->identities );
8289 }
8390
91+ public function testModelFindByIdWithIdentitiesUserNotExists (): void
92+ {
93+ $ user = model (UserModel::class)->where ('active ' , 0 )->withIdentities ()->findById (1 );
94+
95+ $ this ->assertNull ($ user );
96+ }
97+
8498 public function testLastLogin (): void
8599 {
86100 fake (
You can’t perform that action at this time.
0 commit comments