Skip to content

Commit a1cbfba

Browse files
committed
Revert back AC-13828 changes
1 parent dd1d1bd commit a1cbfba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function validateAddresses(QuoteEntity $quote)
159159
$quote->getShippingAddress()->getCustomerAddressId()
160160
);
161161
}
162-
if (empty($addresses) && $quote->getCustomerIsGuest() && $quote->getBillingAddress()->getTelephone()) {
162+
if (empty($addresses) && $quote->getCustomerIsGuest()) {
163163
$billingAddress = $quote->getBillingAddress();
164164
$customerAddress = $this->customerAddressFactory->create();
165165
$customerAddress->setFirstname($billingAddress->getFirstname());

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public function testValidateAddressesNotSavedInAddressBook()
269269
{
270270
$this->expectException(ValidatorException::class);
271271
$this->quoteMock->method('getCustomerIsGuest')->willReturn(true);
272-
$this->quoteAddressMock->expects($this->any())->method('getCustomerAddressId')->willReturn(2);
273272
$this->quoteAddressMock->method('getStreet')->willReturn(['test']);
274273
$this->quoteAddressMock->method('getCustomAttributes')->willReturn(['test']);
275274
$this->customerAddressFactoryMock->method('create')
@@ -279,13 +278,14 @@ public function testValidateAddressesNotSavedInAddressBook()
279278
->getMock();
280279
$this->addressFactoryMock->expects($this->exactly(1))->method('create')->willReturn($addressMock);
281280
$this->quoteMock
282-
->expects($this->atLeastOnce())
281+
->expects($this->atMost(2))
283282
->method('getBillingAddress')
284283
->willReturn($this->quoteAddressMock);
285284
$this->quoteMock
286-
->expects($this->atLeastOnce())
285+
->expects($this->once())
287286
->method('getShippingAddress')
288287
->willReturn($this->quoteAddressMock);
288+
$this->quoteAddressMock->expects($this->any())->method('getCustomerAddressId')->willReturn(null);
289289
$validatorMock = $this->getMockBuilder(Validator::class)
290290
->disableOriginalConstructor()
291291
->getMock();

0 commit comments

Comments
 (0)