Skip to content

Commit b0e0517

Browse files
#25147: Totals Information Management - setting quote shipping method when address method is null - unit test update.
1 parent 8820a5c commit b0e0517

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TotalsInformationManagementTest extends \PHPUnit\Framework\TestCase
3636
*/
3737
private $totalsInformationManagement;
3838

39-
protected function setUp()
39+
protected function setUp(): void
4040
{
4141
$this->objectManager = new ObjectManager($this);
4242
$this->cartRepositoryMock = $this->createMock(
@@ -77,13 +77,15 @@ public function testCalculate(?string $carrierCode, ?string $carrierMethod, int
7777
$addressInformationMock = $this->createMock(
7878
TotalsInformationInterface::class
7979
);
80-
$addressMock = $this->createPartialMock(
81-
Address::class,
82-
[
83-
'setShippingMethod',
84-
'setCollectShippingRates'
85-
]
86-
);
80+
$addressMock = $this->getMockBuilder(Address::class)
81+
->addMethods(
82+
[
83+
'setShippingMethod',
84+
'setCollectShippingRates',
85+
]
86+
)
87+
->disableOriginalConstructor()
88+
->getMock();
8789

8890
$addressInformationMock->expects($this->once())->method('getAddress')->willReturn($addressMock);
8991
$addressInformationMock->expects($this->any())->method('getShippingCarrierCode')->willReturn($carrierCode);

0 commit comments

Comments
 (0)