/** * @test */ public function it_deserializes_objects_by_passing_then_to_the_denormalizer() { $data = array('type' => 'aFlyingDuck', 'payload' => array('duck_name' => 'bob')); $result = new \stdClass(); $this->denormalizerMock->expects(self::atLeastOnce())->method('denormalize')->with(array('duck_name' => 'bob'), 'aFlyingDuck', 'json')->willReturn($result); self::assertSame($result, $this->serializer->deserialize($data)); }