serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]); $this->denormalizer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]); } public function testDeserialize(): void { $adapter = new SymfonySerializerAdapter($this->serializer, $this->denormalizer); $object = $adapter->deserialize('{"param": "string"}', RequestDto::class,'json'); static::assertInstanceOf(RequestDto::class, $object); static::assertEquals('string', $object->param); } public function testArrayToObject(): void { $adapter = new SymfonySerializerAdapter($this->serializer, $this->denormalizer); $object = $adapter->arrayToObject(['param' => 'string'], RequestDto::class); static::assertInstanceOf(RequestDto::class, $object); static::assertEquals('string', $object->param); } }