@@ -273,7 +273,7 @@ public function testSavePaymentInformationAndPlaceOrderWithLocalizedException()
273273 */
274274 private function getMockForAssignBillingAddress (
275275 int $ cartId ,
276- \PHPUnit_Framework_MockObject_MockObject $ billingAddressMock
276+ \PHPUnit_Framework_MockObject_MockObject $ billingAddressMock
277277 ) : void {
278278 $ quoteIdMask = $ this ->createPartialMock (QuoteIdMask::class, ['getQuoteId ' , 'load ' ]);
279279 $ this ->quoteIdMaskFactoryMock ->method ('create ' )
@@ -287,9 +287,11 @@ private function getMockForAssignBillingAddress(
287287 $ billingAddressId = 1 ;
288288 $ quote = $ this ->createMock (Quote::class);
289289 $ quoteBillingAddress = $ this ->createMock (Address::class);
290+ $ shippingRate = $ this ->createPartialMock (\Magento \Quote \Model \Quote \Address \Rate::class, []);
291+ $ shippingRate ->setCarrier ('flatrate ' );
290292 $ quoteShippingAddress = $ this ->createPartialMock (
291293 Address::class,
292- ['setLimitCarrier ' , 'getShippingMethod ' ]
294+ ['setLimitCarrier ' , 'getShippingMethod ' , ' getShippingRateByCode ' ]
293295 );
294296 $ this ->cartRepositoryMock ->method ('getActive ' )
295297 ->with ($ cartId )
@@ -309,6 +311,9 @@ private function getMockForAssignBillingAddress(
309311 $ quote ->expects ($ this ->once ())
310312 ->method ('setBillingAddress ' )
311313 ->with ($ billingAddressMock );
314+ $ quoteShippingAddress ->expects ($ this ->any ())
315+ ->method ('getShippingRateByCode ' )
316+ ->willReturn ($ shippingRate );
312317 $ quote ->expects ($ this ->once ())
313318 ->method ('setDataChanges ' )
314319 ->willReturnSelf ();
0 commit comments