Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions app/code/Magento/Quote/Model/QuoteManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class QuoteManagement implements \Magento\Quote\Api\CartManagementInterface
* @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
* @param \Magento\Customer\Model\CustomerFactory $customerModelFactory
* @param \Magento\Quote\Model\Quote\AddressFactory $quoteAddressFactory,
* @param \Magento\Quote\Model\Quote\AddressFactory $quoteAddressFactory
* @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
* @param StoreManagerInterface $storeManager
* @param \Magento\Checkout\Model\Session $checkoutSession
Expand Down Expand Up @@ -221,7 +221,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createEmptyCart()
{
Expand All @@ -241,7 +241,7 @@ public function createEmptyCart()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createEmptyCartForCustomer($customerId)
{
Expand All @@ -257,7 +257,7 @@ public function createEmptyCartForCustomer($customerId)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function assignCustomer($cartId, $customerId, $storeId)
{
Expand Down Expand Up @@ -332,7 +332,7 @@ protected function createCustomerCart($customerId, $storeId)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
{
Expand All @@ -349,6 +349,8 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)

$data = $paymentMethod->getData();
$quote->getPayment()->importData($data);
} else {
$quote->collectTotals();
}

if ($quote->getCheckoutMethod() === self::METHOD_GUEST) {
Expand Down Expand Up @@ -379,7 +381,7 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getCartForCustomer($customerId)
{
Expand All @@ -406,6 +408,8 @@ public function submit(QuoteEntity $quote, $orderData = [])
}

/**
* Convert quote items to order items for quote
*
* @param Quote $quote
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ protected function setUp()
'setCustomerGroupId',
'assignCustomer',
'getPayment',
'collectTotals'
]);

$this->quoteAddressFactory = $this->createPartialMock(
Expand Down Expand Up @@ -687,6 +688,7 @@ public function testPlaceOrderIfCustomerIsGuest()
$service->expects($this->once())->method('submit')->willReturn($orderMock);

$this->quoteMock->expects($this->atLeastOnce())->method('getId')->willReturn($cartId);
$this->quoteMock->expects($this->once())->method('collectTotals')->willReturnSelf();

$orderMock->expects($this->atLeastOnce())->method('getId')->willReturn($orderId);
$orderMock->expects($this->atLeastOnce())->method('getIncrementId')->willReturn($orderIncrementId);
Expand Down