15 use PHPUnit_Framework_MockObject_MockObject as MockObject;
25 private $shippingAddressManagement;
30 private $shippingMethodManagement;
35 private $shippingProcessor;
39 $this->shippingAddressManagement = $this->getMockBuilder(ShippingAddressManagement::class)
40 ->disableOriginalConstructor()
41 ->setMethods([
'assign'])
44 $this->shippingMethodManagement = $this->getMockBuilder(ShippingMethodManagement::class)
45 ->disableOriginalConstructor()
46 ->setMethods([
'apply'])
51 $this->shippingProcessor =
$objectManager->getObject(ShippingProcessor::class, [
52 'shippingAddressManagement' => $this->shippingAddressManagement,
53 'shippingMethodManagement' => $this->shippingMethodManagement
65 $shipping = $this->getMockForAbstractClass(ShippingInterface::class);
66 $quote = $this->getMockForAbstractClass(CartInterface::class);
69 $address = $this->getMockForAbstractClass(AddressInterface::class);
71 $quote->expects(static::exactly(2))
75 $shipping->expects(static::once())
76 ->method(
'getAddress')
79 $this->shippingAddressManagement->expects(static::once())
83 $shipping->expects(static::exactly(2))
87 $quote->expects(static::once())
88 ->method(
'getItemsCount')
91 $this->shippingMethodManagement->expects(static::once())
95 $this->shippingProcessor->save($shipping,
$quote);
105 [
'carrier_Global_World_Economy',
'carrier',
'Global_World_Economy'],
106 [
'carrier_International_Economy',
'carrier',
'International_Economy'],
107 [
'carrier_Express',
'carrier',
'Express'],
108 [
'flat_rate',
'flat',
'rate'],
testSave($method, $carrierCode, $methodCode)