Skip to content
Snippets Groups Projects
Commit 665ff192 authored by Yuxing Zheng's avatar Yuxing Zheng
Browse files

MAGETWO-36378: Magento\Quote\Api\GuestCartManagement

 - Remove \Magento\Quote\Model\GuestCart\GuestCartManagement::getCartForCustomer
 - Remove associated unit test case
parent 300d8db0
Branches
No related merge requests found
......@@ -84,16 +84,4 @@ class GuestCartManagement implements GuestCartManagementInterface
$quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
return $this->quoteManagement->placeOrder($quoteIdMask->getId());
}
/**
* {@inheritdoc}
*/
public function getCartForCustomer($customerId)
{
$cart = $this->quoteRepository->getActiveForCustomer($customerId);
/** @var $quoteIdMask QuoteIdMask */
$quoteIdMask = $this->quoteIdMaskFactory->create()->load($cart->getId(), 'masked_id');
$cart->setId($quoteIdMask->getId());
return $cart;
}
}
......@@ -115,18 +115,4 @@ class GuestCartManagementTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($orderId, $this->guestCartManagement->placeOrder($cartId));
}
public function testGetCartForCustomer()
{
$maskedCartId = 'masked1cart2id3';
$cartId = 1;
$orderId = 1;
$this->quoteIdMaskMock->expects($this->once())->method('load')->with($cartId, 'masked_id')->willReturnSelf();
$this->quoteIdMaskMock->expects($this->once())->method('getId')->willReturn($maskedCartId);
$this->quoteIdMaskFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteIdMaskMock);
$this->quoteManagementMock->expects($this->once())->method('placeOrder')->willReturn($orderId);
$this->assertEquals($orderId, $this->guestCartManagement->placeOrder($cartId));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment