Skip to content

Commit 814396f

Browse files
committed
MC-36838: Cannot checkout with automatic customer group assignment
1 parent ed29f16 commit 814396f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/Quote/Test/Unit/Observer/Frontend/Quote/Address/CollectTotalsObserverTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function testDispatchWithDefaultCustomerGroupId()
269269
$this->quoteMock->expects($this->once())
270270
->method('getCustomerGroupId')
271271
->willReturn('customerGroupId');
272-
$this->customerMock->expects($this->once())->method('getId')->willReturn('1');
272+
$this->customerMock->expects($this->exactly(2))->method('getId')->willReturn('1');
273273
$this->groupManagementMock->expects($this->once())
274274
->method('getDefaultGroup')
275275
->willReturn($this->groupInterfaceMock);
@@ -329,6 +329,7 @@ public function testDispatchWithCustomerCountryInEU()
329329
->method('setPrevQuoteCustomerGroupId')
330330
->with('customerGroupId');
331331

332+
$this->customerMock->expects($this->once())->method('getId')->willReturn('1');
332333
$this->quoteMock->expects($this->once())->method('setCustomerGroupId')->with('customerGroupId');
333334
$this->quoteMock->expects($this->once())->method('setCustomer')->with($this->customerMock);
334335
$this->customerDataFactoryMock->expects($this->any())
@@ -436,6 +437,8 @@ public function testDispatchWithEmptyShippingAddress()
436437
->method('setPrevQuoteCustomerGroupId')
437438
->with('customerGroupId');
438439

440+
$this->customerMock->expects($this->once())->method('getId')->willReturn('1');
441+
439442
$this->quoteMock->expects($this->once())->method('setCustomerGroupId')->with('customerGroupId');
440443
$this->quoteMock->expects($this->once())->method('setCustomer')->with($this->customerMock);
441444
$this->customerDataFactoryMock->expects($this->any())

0 commit comments

Comments
 (0)