Skip to content

Commit 6b298ee

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-95210' into BugFixPR
2 parents 162fe2d + 551b898 commit 6b298ee

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

app/code/Magento/Persistent/Model/QuoteManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function setGuest($checkQuote = false)
109109
public function convertCustomerCartToGuest()
110110
{
111111
/** @var $quote \Magento\Quote\Model\Quote */
112-
$quote = $this->quoteRepository->get($this->checkoutSession->getQuote()->getId());
112+
$quote = $this->quoteRepository->get($this->checkoutSession->getQuoteId());
113113
if ($quote && $quote->getId()) {
114114
$this->_setQuotePersistent = false;
115115
$quote->setIsActive(true)

app/code/Magento/Persistent/Test/Unit/Model/QuoteManagerTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ public function testConvertCustomerCartToGuest()
245245
$emailArgs = ['email' => null];
246246

247247
$this->checkoutSessionMock->expects($this->once())
248-
->method('getQuote')->willReturn($this->quoteMock);
249-
$this->quoteMock->expects($this->exactly(2))->method('getId')->willReturn($quoteId);
248+
->method('getQuoteId')->willReturn($quoteId);
249+
$this->quoteMock->expects($this->once())->method('getId')->willReturn($quoteId);
250250
$this->quoteRepositoryMock->expects($this->once())->method('get')->with($quoteId)->willReturn($this->quoteMock);
251251
$this->quoteMock->expects($this->once())
252252
->method('setIsActive')->with(true)->willReturn($this->quoteMock);
@@ -286,21 +286,19 @@ public function testConvertCustomerCartToGuest()
286286
public function testConvertCustomerCartToGuestWithEmptyQuote()
287287
{
288288
$this->checkoutSessionMock->expects($this->once())
289-
->method('getQuote')->willReturn($this->quoteMock);
290-
$this->quoteMock->expects($this->once())->method('getId')->willReturn(null);
289+
->method('getQuoteId')->willReturn(null);
291290
$this->quoteRepositoryMock->expects($this->once())->method('get')->with(null)->willReturn(null);
292-
293291
$this->model->convertCustomerCartToGuest();
294292
}
295293

296294
public function testConvertCustomerCartToGuestWithEmptyQuoteId()
297295
{
298296
$this->checkoutSessionMock->expects($this->once())
299-
->method('getQuote')->willReturn($this->quoteMock);
300-
$this->quoteMock->expects($this->once())->method('getId')->willReturn(1);
297+
->method('getQuoteId')->willReturn(1);
301298
$quoteWithNoId = $this->quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class);
302299
$quoteWithNoId->expects($this->once())->method('getId')->willReturn(null);
303300
$this->quoteRepositoryMock->expects($this->once())->method('get')->with(1)->willReturn($quoteWithNoId);
301+
$this->quoteMock->expects($this->once())->method('getId')->willReturn(1);
304302
$this->model->convertCustomerCartToGuest();
305303
}
306304
}

0 commit comments

Comments
 (0)