Skip to content

Commit ce006db

Browse files
MAGETWO-96862: B2B module and persistent shopping cart do not work together and logged out users cannot checkout
1 parent ac40552 commit ce006db

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

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

249249
$this->checkoutSessionMock->expects($this->once())
250-
->method('getQuote')->willReturn($this->quoteMock);
251-
$this->quoteMock->expects($this->exactly(2))->method('getId')->willReturn($quoteId);
250+
->method('getQuoteId')->willReturn($quoteId);
251+
$this->quoteMock->expects($this->once())->method('getId')->willReturn($quoteId);
252252
$this->quoteRepositoryMock->expects($this->once())->method('get')->with($quoteId)->willReturn($this->quoteMock);
253253
$this->quoteMock->expects($this->once())
254254
->method('setIsActive')->with(true)->willReturn($this->quoteMock);
@@ -288,18 +288,15 @@ public function testConvertCustomerCartToGuest()
288288
public function testConvertCustomerCartToGuestWithEmptyQuote()
289289
{
290290
$this->checkoutSessionMock->expects($this->once())
291-
->method('getQuote')->willReturn($this->quoteMock);
292-
$this->quoteMock->expects($this->once())->method('getId')->willReturn(null);
291+
->method('getQuoteId')->willReturn(null);
293292
$this->quoteRepositoryMock->expects($this->once())->method('get')->with(null)->willReturn(null);
294-
295293
$this->model->convertCustomerCartToGuest();
296294
}
297295

298296
public function testConvertCustomerCartToGuestWithEmptyQuoteId()
299297
{
300298
$this->checkoutSessionMock->expects($this->once())
301-
->method('getQuote')->willReturn($this->quoteMock);
302-
$this->quoteMock->expects($this->once())->method('getId')->willReturn(1);
299+
->method('getQuoteId')->willReturn(1);
303300
$quoteWithNoId = $this->quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class);
304301
$quoteWithNoId->expects($this->once())->method('getId')->willReturn(null);
305302
$this->quoteRepositoryMock->expects($this->once())->method('get')->with(1)->willReturn($quoteWithNoId);

0 commit comments

Comments
 (0)