@@ -29,6 +29,8 @@ public function testMarshalling(): void
2929 yield 'foo ' ;
3030 })();
3131 $ dto ->iterableNullable = null ;
32+ $ dto ->assoc = ['foo ' => 'bar ' ];
33+ $ dto ->assocOfType = ['foo ' => (object )['baz ' => 'bar ' ]];
3234
3335 $ result = $ this ->marshal ($ dto );
3436 $ this ->assertSame ([
@@ -40,6 +42,8 @@ public function testMarshalling(): void
4042 'nullableBar ' => null ,
4143 'iterable ' => ['foo ' ],
4244 'iterableNullable ' => null ,
45+ 'assoc ' => ['foo ' => 'bar ' ],
46+ 'assocOfType ' => ['foo ' => ['baz ' => 'bar ' ]],
4347 ], $ result );
4448 }
4549
@@ -54,6 +58,8 @@ public function testUnmarshalling(): void
5458 'nullableBar ' => null ,
5559 'iterable ' => ['it ' ],
5660 'iterableNullable ' => ['itn ' ],
61+ 'assoc ' => ['foo ' => 'bar ' ],
62+ 'assocOfType ' => ['key ' => ['foo ' => 'bar ' ]],
5763 ], new ArrayDto ());
5864
5965 $ this ->assertSame (['foo ' ], $ dto ->foo );
@@ -64,6 +70,8 @@ public function testUnmarshalling(): void
6470 $ this ->assertSame (['it ' ], $ dto ->iterable );
6571 $ this ->assertSame (['itn ' ], $ dto ->iterableNullable );
6672 $ this ->assertSame (null , $ dto ->nullableBar );
73+ $ this ->assertSame (['foo ' => 'bar ' ], $ dto ->assoc );
74+ $ this ->assertEquals (['key ' => (object )['foo ' => 'bar ' ]], $ dto ->assocOfType );
6775 }
6876
6977 public function testSetNullToNotNullable (): void
0 commit comments