Skip to content

Commit 260cc0e

Browse files
committed
MC-37484: Cart query error when trying to switch store view
1 parent 20b46fa commit 260cc0e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function testSetVirtualProduct()
136136

137137
$quoteMock = $this->getMockBuilder(Quote::class)
138138
->addMethods(['setTotalsCollectedFlag'])
139-
->onlyMethods(['getPayment', 'isVirtual', 'getBillingAddress', 'collectTotals', 'save'])
139+
->onlyMethods(['getPayment', 'isVirtual', 'getBillingAddress', 'collectTotals'])
140140
->disableOriginalConstructor()
141141
->getMock();
142142
$this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->willReturn($quoteMock);
@@ -189,7 +189,7 @@ public function testSetVirtualProduct()
189189
->willReturn(true);
190190

191191
$quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->with(false)->willReturnSelf();
192-
$quoteMock->expects($this->once())->method('save')->willReturnSelf();
192+
$this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock);
193193

194194
$paymentMock->expects($this->once())->method('getId')->willReturn($paymentId);
195195
$this->assertEquals($paymentId, $this->model->set($cartId, $methodMock));
@@ -267,7 +267,7 @@ public function testSetSimpleProduct()
267267

268268
$quoteMock = $this->getMockBuilder(Quote::class)
269269
->addMethods(['setTotalsCollectedFlag'])
270-
->onlyMethods(['getPayment', 'isVirtual', 'getShippingAddress', 'collectTotals', 'save'])
270+
->onlyMethods(['getPayment', 'isVirtual', 'getShippingAddress', 'collectTotals'])
271271
->disableOriginalConstructor()
272272
->getMock();
273273
$this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->willReturn($quoteMock);
@@ -324,7 +324,7 @@ public function testSetSimpleProduct()
324324
->willReturn(true);
325325

326326
$quoteMock->expects($this->once())->method('setTotalsCollectedFlag')->with(false)->willReturnSelf();
327-
$quoteMock->expects($this->once())->method('save')->willReturnSelf();
327+
$this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock);
328328

329329
$paymentMock->expects($this->once())->method('getId')->willReturn($paymentId);
330330
$this->assertEquals($paymentId, $this->model->set($cartId, $methodMock));

0 commit comments

Comments
 (0)