@@ -197,12 +197,64 @@ public function testConstructFromArray() : void
197
197
'integer ' => 10 ,
198
198
'string ' => 'stringLn10 ' ,
199
199
'enum ' => 'primary_email ' ,
200
- 'array ' => ['one ' => false , 'two ' => 2 , 'three ' => ' 3 ' , ' four ' => 1.23 ],
200
+ 'array ' => ['one ' => 1 , 'two ' => 2 , 'three ' => 3 ],
201
201
'float ' => 3.1415926 ,
202
202
'ucEnum ' => 'SCHEDULED ' ,
203
203
'intEnum ' => 5 ,
204
204
];
205
+
205
206
$ fixture = new \Tests \Fixtures \TypeTest ($ original );
206
207
$ this ->assertEquals ($ original , $ fixture ->getData ());
207
208
}
209
+
210
+ public function testConstructFromObject () : void
211
+ {
212
+ $ testClass = new \Tests \Fixtures \ClassTest ();
213
+ $ original = [
214
+ 'class ' => $ testClass ,
215
+ ];
216
+ $ fixture = new \Tests \Fixtures \TypeTest ($ original );
217
+
218
+ $ this ->assertEquals ($ testClass , $ fixture ->class );
219
+ }
220
+
221
+ public function testClassArray () : void
222
+ {
223
+ $ testClass = new \Tests \Fixtures \ClassTest ();
224
+ $ original = [
225
+ 'classArray ' => [$ testClass , new \Tests \Fixtures \ClassTest (), ],
226
+ ];
227
+
228
+ $ fixture = new \Tests \Fixtures \TypeTest ($ original );
229
+
230
+ $ this ->assertIsArray ($ fixture ->classArray );
231
+ $ this ->assertCount (2 , $ fixture ->classArray );
232
+ }
233
+
234
+ public function testClassArraySize () : void
235
+ {
236
+ $ testClass = new \Tests \Fixtures \ClassTest ();
237
+ $ original = [
238
+ 'classArraySize ' => [$ testClass , new \Tests \Fixtures \ClassTest (), ],
239
+ ];
240
+
241
+ $ fixture = new \Tests \Fixtures \TypeTest ($ original );
242
+
243
+ $ this ->assertIsArray ($ fixture ->classArraySize );
244
+ $ this ->assertCount (2 , $ fixture ->classArraySize );
245
+ }
246
+
247
+ public function testClassArraySizeMin () : void
248
+ {
249
+ $ testClass = new \Tests \Fixtures \ClassTest ();
250
+ $ original = [
251
+ 'classArraySizeMin ' => [$ testClass , new \Tests \Fixtures \ClassTest (), ],
252
+ ];
253
+
254
+ $ fixture = new \Tests \Fixtures \TypeTest ($ original );
255
+
256
+ $ this ->assertIsArray ($ fixture ->classArraySizeMin );
257
+ $ this ->assertCount (2 , $ fixture ->classArraySizeMin );
258
+ }
259
+
208
260
}
0 commit comments