27 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
28 $this->quoteIdMaskFactoryMock = $this->createPartialMock(
32 $this->shippingInformationManagementMock = $this->createMock(
33 \
Magento\Checkout\Api\ShippingInformationManagementInterface::class
37 \
Magento\Checkout\Model\GuestShippingInformationManagement::class,
39 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock,
40 'shippingInformationManagement' => $this->shippingInformationManagementMock
49 $addressInformationMock = $this->createMock(\
Magento\Checkout\Api\Data\ShippingInformationInterface::class);
51 $quoteIdMaskMock = $this->createPartialMock(\
Magento\
Quote\Model\QuoteIdMask::class, [
'load',
'getQuoteId']);
52 $this->quoteIdMaskFactoryMock->expects($this->once())->method(
'create')->willReturn($quoteIdMaskMock);
54 $quoteIdMaskMock->expects($this->once())->method(
'load')->with(
$cartId,
'masked_id')->willReturnSelf();
55 $quoteIdMaskMock->expects($this->once())->method(
'getQuoteId')->willReturn(
$quoteId);
57 $paymentInformationMock = $this->createMock(\
Magento\Checkout\Api\Data\PaymentDetailsInterface::class);
58 $this->shippingInformationManagementMock->expects($this->once())
59 ->method(
'saveAddressInformation')
60 ->with(
$quoteId, $addressInformationMock)
61 ->willReturn($paymentInformationMock);
63 $this->model->saveAddressInformation(
$cartId, $addressInformationMock);