File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,28 @@ public function testFindAsEntity(): void
100100 $ this ->assertInstanceOf (Time::class, $ user ->created_at );
101101 }
102102
103+ public function testFindArrayAsEntity (): void
104+ {
105+ $ id = $ this ->prepareOneRecord ();
106+
107+ $ users = $ this ->model ->asObject (User::class)->find ([$ id , 999 ]);
108+
109+ $ this ->assertCount (1 , $ users );
110+ $ this ->assertIsInt ($ users [0 ]->id );
111+ $ this ->assertInstanceOf (Time::class, $ users [0 ]->created_at );
112+ }
113+
114+ public function testFindNullAsEntity (): void
115+ {
116+ $ this ->prepareOneRecord ();
117+
118+ $ users = $ this ->model ->asObject (User::class)->find ();
119+
120+ $ this ->assertCount (1 , $ users );
121+ $ this ->assertIsInt ($ users [0 ]->id );
122+ $ this ->assertInstanceOf (Time::class, $ users [0 ]->created_at );
123+ }
124+
103125 public function testFindAllAsArray (): void
104126 {
105127 $ this ->prepareTwoRecords ();
You can’t perform that action at this time.
0 commit comments