@@ -344,10 +344,6 @@ public function testSetMethodWithVirtualProduct()
344
344
$ this ->model ->set ($ cartId , $ carrierCode , $ methodCode );
345
345
}
346
346
347
- /**
348
- * @expectedException \Magento\Framework\Exception\StateException
349
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
350
- */
351
347
public function testSetMethodWithoutShippingAddress ()
352
348
{
353
349
$ cartId = 12 ;
@@ -361,6 +357,7 @@ public function testSetMethodWithoutShippingAddress()
361
357
$ this ->quote ->expects ($ this ->once ())->method ('isVirtual ' )->will ($ this ->returnValue (false ));
362
358
$ this ->quote ->expects ($ this ->once ())
363
359
->method ('getShippingAddress ' )->will ($ this ->returnValue ($ this ->shippingAddress ));
360
+ $ this ->quote ->expects ($ this ->once ())->method ('collectTotals ' )->willReturnSelf ();
364
361
$ this ->shippingAddress ->expects ($ this ->once ())->method ('getCountryId ' )->will ($ this ->returnValue (null ));
365
362
366
363
$ this ->model ->set ($ cartId , $ carrierCode , $ methodCode );
@@ -402,10 +399,6 @@ public function testSetMethodWithCouldNotSaveException()
402
399
$ this ->model ->set ($ cartId , $ carrierCode , $ methodCode );
403
400
}
404
401
405
- /**
406
- * @expectedException \Magento\Framework\Exception\StateException
407
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
408
- */
409
402
public function testSetMethodWithoutAddress ()
410
403
{
411
404
$ cartId = 12 ;
@@ -420,6 +413,7 @@ public function testSetMethodWithoutAddress()
420
413
$ this ->quote ->expects ($ this ->once ())
421
414
->method ('getShippingAddress ' )
422
415
->willReturn ($ this ->shippingAddress );
416
+ $ this ->quote ->expects ($ this ->once ())->method ('collectTotals ' )->willReturnSelf ();
423
417
$ this ->shippingAddress ->expects ($ this ->once ())->method ('getCountryId ' );
424
418
425
419
$ this ->model ->set ($ cartId , $ carrierCode , $ methodCode );
0 commit comments