public function testSupportsNormalization() { $this->
assertTrue($this->denormalizer->
supportsDenormalization([], 'stdClass', 'any',
[UnwrappingDenormalizer::UNWRAP_PATH => '[baz][inner]'
]));
$this->
assertFalse($this->denormalizer->
supportsDenormalization([], 'stdClass', 'any',
[UnwrappingDenormalizer::UNWRAP_PATH => '[baz][inner]', 'unwrapped' => true
]));
$this->
assertFalse($this->denormalizer->
supportsDenormalization([], 'stdClass', 'any',
[]));
} public function testDenormalize() { $expected =
new ObjectDummy();
$expected->
setBaz(true
);
$expected->bar = 'bar';
$expected->
setFoo('foo'
);
$this->serializer->
expects($this->
exactly(1
)) ->
method('denormalize'
) ->
with(['foo' => 'foo', 'bar' => 'bar', 'baz' => true
]) ->
willReturn($expected);
$result =
$this->denormalizer->
denormalize( ['data' =>
['foo' => 'foo', 'bar' => 'bar', 'baz' => true
]],
ObjectDummy::
class,