Skip to content

Commit ac843d3

Browse files
committed
MC-37666: Incorrect Customer TAX Class saved with Quote when VAT Validation used on Guest orders. Fix unit test.
1 parent 544296e commit ac843d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ protected function setUp(): void
247247
'getPayment',
248248
'setCheckoutMethod',
249249
'setCustomerIsGuest',
250+
'getCustomer',
250251
'getId'
251252
]
252253
)
@@ -799,6 +800,12 @@ public function testPlaceOrderIfCustomerIsGuest()
799800
$this->quoteMock->expects($this->once())
800801
->method('getCheckoutMethod')
801802
->willReturn(Onepage::METHOD_GUEST);
803+
$customerMock = $this->getMockBuilder(Customer::class)
804+
->disableOriginalConstructor()
805+
->getMock();
806+
$this->quoteMock->expects($this->once())
807+
->method('getCustomer')
808+
->willReturn($customerMock);
802809
$this->quoteMock->expects($this->once())->method('setCustomerId')->with(null)->willReturnSelf();
803810
$this->quoteMock->expects($this->once())->method('setCustomerEmail')->with($email)->willReturnSelf();
804811

@@ -866,6 +873,9 @@ public function testPlaceOrderIfCustomerIsGuest()
866873
$this->assertEquals($orderId, $service->placeOrder($cartId));
867874
}
868875

876+
/**
877+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
878+
*/
869879
public function testPlaceOrder()
870880
{
871881
$cartId = 323;

0 commit comments

Comments
 (0)