function it_returns_flat_data_with_french_attribute($channelManager, $serializer, ChannelInterface $channel, ProductInterface $product, ProductValueInterface $number, AttributeInterface $attribute, MetricInterface $metric, ProductValueInterface $metricValue, ProductPriceInterface $price, ProductValueInterface $priceValue) { $this->setLocale('fr_FR'); $attribute->getAttributeType()->willReturn('pim_catalog_number'); $number->getDecimal('10.50'); $number->getAttribute()->willReturn($attribute); $attribute->getAttributeType()->willReturn('pim_catalog_metric'); $metric->getData()->willReturn('10.00'); $metric->getUnit()->willReturn('GRAM'); $metricValue->getAttribute()->willReturn($attribute); $metricValue->getData()->willReturn($metric); $attribute->getAttributeType()->willReturn('pim_catalog_price_collection'); $price->getData()->willReturn('10'); $price->getCurrency()->willReturn('EUR'); $priceValue->getAttribute()->willReturn($attribute); $priceValue->getData()->willReturn($price); $product->getValues()->willReturn([$number, $metricValue, $priceValue]); $serializer->normalize($product, 'flat', ['scopeCode' => 'mobile', 'localeCodes' => '', 'locale' => 'fr_FR'])->willReturn(['10,50', '10,00 GRAM', '10,00 EUR', '25/10/2015']); $channelManager->getChannelByCode('mobile')->willReturn($channel); $this->setChannelCode('mobile'); $this->process($product)->shouldReturn(['media' => [], 'product' => ['10,50', '10,00 GRAM', '10,00 EUR', '25/10/2015']]); }