->
willReturn($expected);
$result =
$this->denormalizer->
denormalize( ['data' =>
['foo' => 'foo', 'bar' => 'bar', 'baz' => true
]],
ObjectDummy::
class,
'any',
[UnwrappingDenormalizer::UNWRAP_PATH => '[data]'
] );
$this->
assertEquals('foo',
$result->
getFoo());
$this->
assertEquals('bar',
$result->bar
);
$this->
assertTrue($result->
isBaz());
} public function testDenormalizeInvalidPath() { $this->serializer->
expects($this->
exactly(1
)) ->
method('denormalize'
) ->
with(null
) ->
willReturn(new ObjectDummy());
$obj =
$this->denormalizer->
denormalize( ['data' =>
['foo' => 'foo', 'bar' => 'bar', 'baz' => true
]],