@@ -273,7 +273,7 @@ public function testSavePaymentInformationAndPlaceOrderWithLocalizedException()
273
273
*/
274
274
private function getMockForAssignBillingAddress (
275
275
int $ cartId ,
276
- \PHPUnit_Framework_MockObject_MockObject $ billingAddressMock
276
+ \PHPUnit_Framework_MockObject_MockObject $ billingAddressMock
277
277
) : void {
278
278
$ quoteIdMask = $ this ->createPartialMock (QuoteIdMask::class, ['getQuoteId ' , 'load ' ]);
279
279
$ this ->quoteIdMaskFactoryMock ->method ('create ' )
@@ -287,9 +287,11 @@ private function getMockForAssignBillingAddress(
287
287
$ billingAddressId = 1 ;
288
288
$ quote = $ this ->createMock (Quote::class);
289
289
$ quoteBillingAddress = $ this ->createMock (Address::class);
290
+ $ shippingRate = $ this ->createPartialMock (\Magento \Quote \Model \Quote \Address \Rate::class, []);
291
+ $ shippingRate ->setCarrier ('flatrate ' );
290
292
$ quoteShippingAddress = $ this ->createPartialMock (
291
293
Address::class,
292
- ['setLimitCarrier ' , 'getShippingMethod ' ]
294
+ ['setLimitCarrier ' , 'getShippingMethod ' , ' getShippingRateByCode ' ]
293
295
);
294
296
$ this ->cartRepositoryMock ->method ('getActive ' )
295
297
->with ($ cartId )
@@ -309,6 +311,9 @@ private function getMockForAssignBillingAddress(
309
311
$ quote ->expects ($ this ->once ())
310
312
->method ('setBillingAddress ' )
311
313
->with ($ billingAddressMock );
314
+ $ quoteShippingAddress ->expects ($ this ->any ())
315
+ ->method ('getShippingRateByCode ' )
316
+ ->willReturn ($ shippingRate );
312
317
$ quote ->expects ($ this ->once ())
313
318
->method ('setDataChanges ' )
314
319
->willReturnSelf ();
0 commit comments