7 declare(strict_types=1);
11 use PHPUnit\Framework\TestCase;
18 private $localeFormatMock;
27 $this->localeFormatMock = $this->createMock(\
Magento\Framework\Locale\Format::class);
28 $this->model = new \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Variations\Prices(
29 $this->localeFormatMock
46 $priceInfoMock = $this->createMock(\
Magento\Framework\Pricing\PriceInfo\Base::class);
47 $priceMock = $this->createMock(\
Magento\Framework\Pricing\
Price\PriceInterface::class);
48 $priceInfoMock->expects($this->atLeastOnce())->method(
'getPrice')->willReturn($priceMock);
50 $amountMock = $this->createMock(\
Magento\Framework\Pricing\Amount\AmountInterface::class);
51 $amountMock->expects($this->atLeastOnce())->method(
'getValue')->willReturn(500);
52 $amountMock->expects($this->atLeastOnce())->method(
'getBaseAmount')->willReturn(1000);
53 $priceMock->expects($this->atLeastOnce())->method(
'getAmount')->willReturn($amountMock);
55 $this->localeFormatMock->expects($this->atLeastOnce())
57 ->withConsecutive([500], [1000], [500])
58 ->will($this->onConsecutiveCalls(500, 1000, 500));
60 $this->assertEquals($expected, $this->model->getFormattedPrices($priceInfoMock));