};
$data['f2'
] =
new class(new \
ArrayObject(['k' => 'v'
])) { public $map;
public function __construct(\ArrayObject
$map) { $this->map =
$map;
} };
$data['g1'
] =
new Baz([]);
$data['g2'
] =
new Baz(['greg'
]);
yield [$serializer,
$data];
} /** @dataProvider provideObjectOrCollectionTests */
public function testNormalizeWithCollection(Serializer
$serializer, array
$data) { $expected = '{"a1":[],"a2":{"k":"v"},"b1":[],"b2":{"k":"v"},"c1":{"nested":[]},"c2":{"nested":{"k":"v"}},"d1":{"nested":[]},"d2":{"nested":{"k":"v"}},"e1":{"map":[]},"e2":{"map":{"k":"v"}},"f1":{"map":[]},"f2":{"map":{"k":"v"}},"g1":{"list":[],"settings":[]},"g2":{"list":["greg"],"settings":[]}}';
$this->
assertSame($expected,
$serializer->
serialize($data, 'json'
));
}