Skip to content

Commit 358d0bd

Browse files
committed
AC-15385::Wrong product price is displayed on the shopping cart with different currencies in different store views
1 parent f022c4e commit 358d0bd

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ public function testMapItemSetsExtensionAttributePriceForTaxCalculation(): void
447447
$quoteDetailsItem->method('setDiscountAmount')->willReturnSelf();
448448
$quoteDetailsItem->method('setParentCode')->willReturnSelf();
449449

450-
$extension = $this->createMock(QuoteDetailsItemExtensionInterface::class);
450+
$extension = $this->getMockBuilder(QuoteDetailsItemExtensionInterface::class)
451+
->onlyMethods(['setPriceForTaxCalculation', 'getPriceForTaxCalculation'])
452+
->getMock();
451453
$extension->expects($this->once())
452454
->method('setPriceForTaxCalculation')
453455
->with(9.99)
@@ -1248,17 +1250,9 @@ public function testMapItemsChildrenCalculatedIncludesParentChildAndExtraTaxable
12481250

12491251
// mapItem should be called first for parent (no parentCode), then for child with parentCode 'parent-code'
12501252
$sut->method('mapItem')->willReturnCallback(
1251-
function (
1252-
$factory,
1253-
$item,
1254-
$incl,
1255-
$base,
1256-
$parentCode
1257-
) use (
1258-
$parentItem,
1259-
$parentMapped,
1260-
$childMapped
1261-
) {
1253+
function (...$args) use ($parentItem, $parentMapped, $childMapped) {
1254+
$item = $args[1] ?? null;
1255+
$parentCode = $args[4] ?? null;
12621256
if ($item === $parentItem) {
12631257
// parent mapping: no parent code
12641258
return $parentMapped;
@@ -1288,7 +1282,9 @@ public function testConstructorFallsBackToObjectManagerForOptionalDependencies()
12881282
// Do not call getInstance() in unit context; no original OM to restore
12891283

12901284
$extFactory = $this->createMock(QuoteDetailsItemExtensionInterfaceFactory::class);
1291-
$ext = $this->createMock(QuoteDetailsItemExtensionInterface::class);
1285+
$ext = $this->getMockBuilder(QuoteDetailsItemExtensionInterface::class)
1286+
->onlyMethods(['setPriceForTaxCalculation', 'getPriceForTaxCalculation'])
1287+
->getMock();
12921288
$extFactory->method('create')->willReturn($ext);
12931289

12941290
$customerAccount = $this->createMock(CustomerAccountManagement::class);
@@ -1352,7 +1348,6 @@ public function testConstructorFallsBackToObjectManagerForOptionalDependencies()
13521348
->willReturnSelf();
13531349

13541350
$billingAddressFromQuote = $this->createMock(QuoteAddress::class);
1355-
$defaultBillingCustomerAddress = $this->createMock(CustomerAddress::class);
13561351

13571352
$customerAccount->expects($this->once())
13581353
->method('getDefaultBillingAddress')

0 commit comments

Comments
 (0)