Skip to content
Snippets Groups Projects
Commit 7ff22bf3 authored by marina's avatar marina
Browse files

Update product option value getPrice unit test

parent 33aa293e
Branches
No related merge requests found
......@@ -164,13 +164,27 @@ class ValueTest extends \PHPUnit\Framework\TestCase
private function getMockedProduct()
{
$mockBuilder = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
->setMethods(['getFinalPrice', '__wakeup'])
->setMethods(['getPriceInfo', '__wakeup'])
->disableOriginalConstructor();
$mock = $mockBuilder->getMock();
$mock->expects($this->any())
->method('getFinalPrice')
->will($this->returnValue(10));
$priceInfoMock = $this->getMockForAbstractClass(
\Magento\Framework\Pricing\PriceInfoInterface::class,
[],
'',
false,
false,
true,
['getPrice']
);
$priceMock = $this->getMockForAbstractClass(\Magento\Framework\Pricing\Price\PriceInterface::class);
$priceInfoMock->expects($this->any())->method('getPrice')->willReturn($priceMock);
$mock->expects($this->any())->method('getPriceInfo')->willReturn($priceInfoMock);
$priceMock->expects($this->any())->method('getValue')->willReturn(10);
return $mock;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment