function it_denormalizes_association_with_products(Association $association, Serializer $serializer, ProductInterface $product1, ProductInterface $product2)
{
// Mock product denormalization
$serializer->denormalize('foo', self::PRODUCT_CLASS, self::FORMAT_CSV)->willReturn($product1);
$serializer->denormalize('bar', self::PRODUCT_CLASS, self::FORMAT_CSV)->willReturn($product2);
$association->addProduct($product1)->shouldBeCalled();
$association->addProduct($product2)->shouldBeCalled();
$this->setSerializer($serializer);
$this->denormalize('foo,bar', self::ENTITY_CLASS, self::FORMAT_CSV, ['part' => 'products', 'entity' => $association]);
}