File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ public function validateAddresses(QuoteEntity $quote)
159
159
$ quote ->getShippingAddress ()->getCustomerAddressId ()
160
160
);
161
161
}
162
- if (empty ($ addresses ) && $ quote ->getCustomerIsGuest () && $ quote -> getBillingAddress ()-> getTelephone () ) {
162
+ if (empty ($ addresses ) && $ quote ->getCustomerIsGuest ()) {
163
163
$ billingAddress = $ quote ->getBillingAddress ();
164
164
$ customerAddress = $ this ->customerAddressFactory ->create ();
165
165
$ customerAddress ->setFirstname ($ billingAddress ->getFirstname ());
Original file line number Diff line number Diff line change @@ -269,7 +269,6 @@ public function testValidateAddressesNotSavedInAddressBook()
269
269
{
270
270
$ this ->expectException (ValidatorException::class);
271
271
$ this ->quoteMock ->method ('getCustomerIsGuest ' )->willReturn (true );
272
- $ this ->quoteAddressMock ->expects ($ this ->any ())->method ('getCustomerAddressId ' )->willReturn (2 );
273
272
$ this ->quoteAddressMock ->method ('getStreet ' )->willReturn (['test ' ]);
274
273
$ this ->quoteAddressMock ->method ('getCustomAttributes ' )->willReturn (['test ' ]);
275
274
$ this ->customerAddressFactoryMock ->method ('create ' )
@@ -279,13 +278,14 @@ public function testValidateAddressesNotSavedInAddressBook()
279
278
->getMock ();
280
279
$ this ->addressFactoryMock ->expects ($ this ->exactly (1 ))->method ('create ' )->willReturn ($ addressMock );
281
280
$ this ->quoteMock
282
- ->expects ($ this ->atLeastOnce ( ))
281
+ ->expects ($ this ->atMost ( 2 ))
283
282
->method ('getBillingAddress ' )
284
283
->willReturn ($ this ->quoteAddressMock );
285
284
$ this ->quoteMock
286
- ->expects ($ this ->atLeastOnce ())
285
+ ->expects ($ this ->once ())
287
286
->method ('getShippingAddress ' )
288
287
->willReturn ($ this ->quoteAddressMock );
288
+ $ this ->quoteAddressMock ->expects ($ this ->any ())->method ('getCustomerAddressId ' )->willReturn (null );
289
289
$ validatorMock = $ this ->getMockBuilder (Validator::class)
290
290
->disableOriginalConstructor ()
291
291
->getMock ();
You can’t perform that action at this time.
0 commit comments