Skip to content

Commit e93c44e

Browse files
committed
MAGETWO-66697: GET request to view quote details doesn't work
1 parent 8edd209 commit e93c44e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

app/code/Magento/Quote/Model/QuoteRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function __construct(
105105
public function get($cartId, array $sharedStoreIds = [])
106106
{
107107
if (!isset($this->quotesById[$cartId])) {
108-
$quote = $this->loadQuote('load', 'cartId', $cartId, $sharedStoreIds);
108+
$quote = $this->loadQuote('loadByIdWithoutStore', 'cartId', $cartId, $sharedStoreIds);
109109
$this->getLoadHandler()->load($quote);
110110
$this->quotesById[$cartId] = $quote;
111111
}

app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ protected function setUp()
9090
\Magento\Quote\Model\Quote::class,
9191
[
9292
'load',
93+
'loadByIdWithoutStore',
9394
'loadByCustomer',
9495
'getIsActive',
9596
'getId',
@@ -169,7 +170,7 @@ public function testGetWithExceptionById()
169170
$this->storeMock->expects($this->once())->method('getId')->willReturn(1);
170171
$this->quoteMock->expects($this->never())->method('setSharedStoreIds');
171172
$this->quoteMock->expects($this->once())
172-
->method('load')
173+
->method('loadByIdWithoutStore')
173174
->with($cartId)
174175
->willReturn($this->storeMock);
175176
$this->quoteMock->expects($this->once())->method('getId')->willReturn(false);
@@ -193,7 +194,7 @@ public function testGet()
193194
$this->quoteMock->expects(static::never())
194195
->method('setSharedStoreIds');
195196
$this->quoteMock->expects(static::once())
196-
->method('load')
197+
->method('loadByIdWithoutStore')
197198
->with($cartId)
198199
->willReturn($this->storeMock);
199200
$this->quoteMock->expects(static::once())
@@ -226,7 +227,7 @@ public function testGetForCustomerAfterGet()
226227
$this->quoteMock->expects(static::never())
227228
->method('setSharedStoreIds');
228229
$this->quoteMock->expects(static::once())
229-
->method('load')
230+
->method('loadByIdWithoutStore')
230231
->with($cartId)
231232
->willReturn($this->storeMock);
232233
$this->quoteMock->expects(static::once())
@@ -260,7 +261,7 @@ public function testGetWithSharedStoreIds()
260261
->with($sharedStoreIds)
261262
->willReturnSelf();
262263
$this->quoteMock->expects($this->once())
263-
->method('load')
264+
->method('loadByIdWithoutStore')
264265
->with($cartId)
265266
->willReturn($this->storeMock);
266267
$this->quoteMock->expects($this->once())->method('getId')->willReturn($cartId);
@@ -318,7 +319,7 @@ public function testGetActiveWithExceptionById()
318319
$this->storeMock->expects($this->once())->method('getId')->willReturn(1);
319320
$this->quoteMock->expects($this->never())->method('setSharedStoreIds');
320321
$this->quoteMock->expects($this->once())
321-
->method('load')
322+
->method('loadByIdWithoutStore')
322323
->with($cartId)
323324
->willReturn($this->storeMock);
324325
$this->quoteMock->expects($this->once())->method('getId')->willReturn(false);
@@ -340,7 +341,7 @@ public function testGetActiveWithExceptionByIsActive()
340341
$this->storeMock->expects($this->once())->method('getId')->willReturn(1);
341342
$this->quoteMock->expects($this->never())->method('setSharedStoreIds');
342343
$this->quoteMock->expects($this->once())
343-
->method('load')
344+
->method('loadByIdWithoutStore')
344345
->with($cartId)
345346
->willReturn($this->storeMock);
346347
$this->quoteMock->expects($this->once())->method('getId')->willReturn($cartId);
@@ -363,7 +364,7 @@ public function testGetActive()
363364
$this->storeMock->expects($this->once())->method('getId')->willReturn(1);
364365
$this->quoteMock->expects($this->never())->method('setSharedStoreIds');
365366
$this->quoteMock->expects($this->once())
366-
->method('load')
367+
->method('loadByIdWithoutStore')
367368
->with($cartId)
368369
->willReturn($this->storeMock);
369370
$this->quoteMock->expects($this->once())->method('getId')->willReturn($cartId);
@@ -390,7 +391,7 @@ public function testGetActiveWithSharedStoreIds()
390391
->with($sharedStoreIds)
391392
->willReturnSelf();
392393
$this->quoteMock->expects($this->once())
393-
->method('load')
394+
->method('loadByIdWithoutStore')
394395
->with($cartId)
395396
->willReturn($this->storeMock);
396397
$this->quoteMock->expects($this->once())->method('getId')->willReturn($cartId);
@@ -449,7 +450,7 @@ public function testSave()
449450
$this->quoteMock->expects($this->once())->method('getId')->willReturn($cartId);
450451
$this->quoteMock->expects($this->once())->method('setSharedStoreIds');
451452
$this->quoteMock->expects($this->once())
452-
->method('load')
453+
->method('loadByIdWithoutStore')
453454
->with($cartId)
454455
->willReturn($this->storeMock);
455456
$this->loadHandlerMock->expects($this->once())

0 commit comments

Comments
 (0)