9 use \Magento\Catalog\Pricing\Price\RegularPrice;
47 $this->saleableItemMock = $this->createMock(\
Magento\Catalog\Model\Product::class);
48 $this->priceInfoMock = $this->createMock(\
Magento\Framework\Pricing\PriceInfo\Base::class);
49 $this->calculatorMock = $this->createMock(\
Magento\Framework\Pricing\Adjustment\Calculator::class);
51 $this->saleableItemMock->expects($this->once())
52 ->method(
'getPriceInfo')
53 ->will($this->returnValue($this->priceInfoMock));
55 $this->priceCurrencyMock = $this->createMock(\
Magento\Framework\Pricing\PriceCurrencyInterface::class);
58 $this->saleableItemMock,
60 $this->calculatorMock,
61 $this->priceCurrencyMock
74 $this->saleableItemMock->expects($this->once())
76 ->will($this->returnValue(
$price));
77 $this->priceCurrencyMock->expects($this->any())
78 ->method(
'convertAndRound')
80 ->will($this->returnValue($convertedPrice));
81 $this->assertEquals($convertedPrice, $this->regularPrice->getValue());
83 $this->assertEquals($convertedPrice, $this->regularPrice->getValue());
94 'With price' => [100.00],
95 'Without price' => [
false]
105 $convertedPrice = 56.32;
108 $this->saleableItemMock->expects($this->once())
110 ->will($this->returnValue($priceValue));
111 $this->priceCurrencyMock->expects($this->any())
112 ->method(
'convertAndRound')
114 ->will($this->returnValue($convertedPrice));
115 $this->calculatorMock->expects($this->once())
116 ->method(
'getAmount')
117 ->with($this->equalTo($convertedPrice))
118 ->will($this->returnValue($amountValue));
119 $this->assertEquals($amountValue, $this->regularPrice->getAmount());
testGetValueDataProvider()