Skip to content

Commit 9320e34

Browse files
committed
ACP2E-2950: [Cloud] Bundle Product wrong pricing in order confirmation
1 parent 8f1f09f commit 9320e34

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Catalog\Model\Product;
1717
use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
1818
use Magento\Framework\Serialize\Serializer\Json;
19+
use Magento\Framework\Pricing\PriceCurrencyInterface;
1920
use PHPUnit\Framework\TestCase;
2021

2122
/**
@@ -34,8 +35,22 @@ class OptionTest extends TestCase
3435
protected function setUp(): void
3536
{
3637
parent::setUp();
38+
$priceCurrency = $this->getMockBuilder(PriceCurrencyInterface::class)
39+
->disableOriginalConstructor()
40+
->onlyMethods(
41+
['convert','convertAndRound', 'format','convertAndFormat','getCurrencySymbol','getCurrency', 'round']
42+
)
43+
->getMock();
44+
$priceCurrency->method('convert')
45+
->willReturnCallback(
46+
function ($price, $scope) {
47+
return $price;
48+
}
49+
);
50+
3751
$this->model = new Option(
38-
new Json()
52+
new Json(),
53+
$priceCurrency
3954
);
4055
}
4156

@@ -48,7 +63,7 @@ public function testGetSelectionOptions(array $customOptions, array $expected):
4863
{
4964
$bundleProduct = $this->getMockBuilder(Product::class)
5065
->disableOriginalConstructor()
51-
->onlyMethods(['getTypeInstance', 'getPriceModel'])
66+
->onlyMethods(['getTypeInstance', 'getPriceModel', 'getStore'])
5267
->getMock();
5368

5469
$typeInstance = $this->createMock(Type::class);

0 commit comments

Comments
 (0)