Skip to content

Commit 5ec0d81

Browse files
AC-2044::Cart Price Rule with shipping method set as condition is not working Magento - fixed unit tests against changes
1 parent e5e7eb9 commit 5ec0d81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/Magento/Checkout/Test/Unit/Model/TotalsInformationManagementTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function testCalculate(?string $carrierCode, ?string $carrierMethod, int
8585
'setCollectShippingRates',
8686
]
8787
)
88+
->onlyMethods(['save'])
8889
->disableOriginalConstructor()
8990
->getMock();
9091

@@ -97,6 +98,9 @@ public function testCalculate(?string $carrierCode, ?string $carrierMethod, int
9798
->method('setCollectShippingRates')->with(true)->willReturn($addressMock);
9899
$addressMock->expects($this->exactly($methodSetCount))
99100
->method('setShippingMethod')->with($carrierCode . '_' . $carrierMethod);
101+
$addressMock->expects($this->exactly($methodSetCount))
102+
->method('save')
103+
->willReturnSelf();
100104
$cartMock->expects($this->once())->method('collectTotals');
101105

102106
$this->totalsInformationManagement->calculate($cartId, $addressInformationMock);

0 commit comments

Comments
 (0)