Skip to content

Commit 5b69b87

Browse files
author
Cari Spruiell
committed
MAGETWO-37464: Merge and Fix Builds
- fix merge conflicts
1 parent f78a4af commit 5b69b87

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

app/code/Magento/Quote/Model/GuestCart/GuestCartManagement.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@ public function placeOrder($cartId)
8181
{
8282
/** @var $quoteIdMask QuoteIdMask */
8383
$quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
84-
<<<<<<< .merge_file_PPOyn2
84+
$this->cartRepository->get($quoteIdMask->getQuoteId())
85+
->setCheckoutMethod(CartManagementInterface::METHOD_GUEST);
8586
return $this->quoteManagement->placeOrder($quoteIdMask->getQuoteId());
86-
=======
87-
$this->cartRepository->get($quoteIdMask->getId())->setCheckoutMethod(CartManagementInterface::METHOD_GUEST);
88-
return $this->quoteManagement->placeOrder($quoteIdMask->getId());
89-
>>>>>>> .merge_file_x9jgp1
9087
}
9188
}

app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartManagementTest.php

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ class GuestCartManagementTest extends \PHPUnit_Framework_TestCase
2929
*/
3030
protected $quoteIdMaskMock;
3131

32+
/**
33+
* @var \PHPUnit_Framework_MockObject_MockObject
34+
*/
35+
protected $cartRepositoryMock;
36+
37+
/**
38+
* @var \PHPUnit_Framework_MockObject_MockObject
39+
*/
40+
protected $quoteMock;
41+
3242
/**
3343
* @var \Magento\Quote\Model\GuestCart\GuestCartManagement
3444
*/
@@ -62,11 +72,30 @@ protected function setUp()
6272
false
6373
);
6474

75+
$this->cartRepositoryMock = $this->getMock(
76+
'Magento\Quote\Api\CartRepositoryInterface',
77+
['get', 'getList'],
78+
[],
79+
'',
80+
false
81+
);
82+
83+
$this->quoteMock = $this->getMockForAbstractClass(
84+
'Magento\Quote\Api\Data\CartInterface',
85+
[],
86+
'',
87+
false,
88+
true,
89+
true,
90+
['setCheckoutMethod']
91+
);
92+
6593
$this->guestCartManagement = $objectManager->getObject(
6694
'Magento\Quote\Model\GuestCart\GuestCartManagement',
6795
[
6896
'quoteManagement' => $this->quoteManagementMock,
69-
'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock
97+
'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock,
98+
'cartRepository' => $this->cartRepositoryMock
7099
]
71100
);
72101
}
@@ -107,7 +136,9 @@ public function testPlaceOrder()
107136
$orderId = 1;
108137

109138
$this->quoteIdMaskMock->expects($this->once())->method('load')->with($cartId, 'masked_id')->willReturnSelf();
110-
$this->quoteIdMaskMock->expects($this->once())->method('getQuoteId')->willReturn($maskedCartId);
139+
$this->cartRepositoryMock->expects($this->once())->method('get')->willReturn($this->quoteMock);
140+
$this->quoteMock->expects($this->once())->method('setCheckoutMethod');
141+
$this->quoteIdMaskMock->expects($this->any())->method('getQuoteId')->willReturn($maskedCartId);
111142
$this->quoteIdMaskFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteIdMaskMock);
112143
$this->quoteManagementMock->expects($this->once())->method('placeOrder')->willReturn($orderId);
113144

0 commit comments

Comments
 (0)