/**
  * @param array $inputData
  * @param array $expectedData
  *
  * @dataProvider formatOfferProvider
  */
 public function testFormatOffer(array $inputData, array $expectedData)
 {
     /* @var $item QuoteProductOffer */
     $item = $inputData['item'];
     $item->setQuantity($inputData['quantity'])->setProductUnit($inputData['unit'])->setProductUnitCode($inputData['unitCode'])->setPrice($inputData['price']);
     $this->productUnitValueFormatter->expects($inputData['unit'] ? $this->once() : $this->never())->method('format')->with($inputData['quantity'], $inputData['unitCode'])->will($this->returnValue($expectedData['formattedUnits']));
     $price = $inputData['price'] ?: new Price();
     $this->numberFormatter->expects($price ? $this->once() : $this->never())->method('formatCurrency')->with($price->getValue(), $price->getCurrency())->will($this->returnValue($expectedData['formattedPrice']));
     $this->productUnitLabelFormatter->expects($this->once())->method('format')->with($inputData['unitCode'])->will($this->returnValue($expectedData['formattedUnit']));
     $this->translator->expects($this->once())->method('transChoice')->with($expectedData['transConstant'], $expectedData['transIndex'], ['{units}' => $expectedData['formattedUnits'], '{price}' => $expectedData['formattedPrice'], '{unit}' => $expectedData['formattedUnit']]);
     $this->formatter->formatOffer($inputData['item']);
 }
 /**
  * @param Price $price
  * @param array $options
  * @param string $expected
  * @dataProvider formatCurrencyDataProvider
  */
 public function testFormatCurrency(Price $price, array $options, $expected)
 {
     $this->formatter->expects($this->once())->method('formatCurrency')->with($price->getValue(), $price->getCurrency(), $options['attributes'], $options['textAttributes'], $options['symbols'], $options['locale'])->will($this->returnValue($expected));
     $this->assertEquals($expected, $this->extension->formatPrice($price, $options));
 }