File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
app/code/Magento/Persistent Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ public function convertCustomerCartToGuest()
182
182
$ quote ->getAddressesCollection ()->walk ('setCustomerId ' , ['customerId ' => null ]);
183
183
$ quote ->getAddressesCollection ()->walk ('setEmail ' , ['email ' => null ]);
184
184
$ quote ->collectTotals ();
185
+ $ quote ->getCustomer ()->setId (null );
185
186
$ this ->persistentSession ->getSession ()->removePersistentCookie ();
186
187
$ this ->persistentSession ->setSession (null );
187
188
$ this ->quoteRepository ->save ($ quote );
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ protected function setUp(): void
134
134
'setExtensionAttributes ' ,
135
135
'__wakeup ' ,
136
136
'setCustomer ' ,
137
+ 'getCustomer '
137
138
])
138
139
->disableOriginalConstructor ()
139
140
->getMock ();
@@ -343,6 +344,13 @@ public function testConvertCustomerCartToGuest()
343
344
->method ('setIsPersistent ' )->with (false )->willReturn ($ this ->quoteMock );
344
345
$ this ->quoteMock ->expects ($ this ->exactly (3 ))
345
346
->method ('getAddressesCollection ' )->willReturn ($ this ->abstractCollectionMock );
347
+ $ customerMock = $ this ->createMock (CustomerInterface::class);
348
+ $ customerMock ->expects ($ this ->once ())
349
+ ->method ('setId ' )
350
+ ->with (null )
351
+ ->willReturnSelf ();
352
+ $ this ->quoteMock ->expects ($ this ->once ())
353
+ ->method ('getCustomer ' )->willReturn ($ customerMock );
346
354
$ this ->abstractCollectionMock ->expects ($ this ->exactly (3 ))->method ('walk ' )->with (
347
355
$ this ->logicalOr (
348
356
$ this ->equalTo ('setCustomerAddressId ' ),
You can’t perform that action at this time.
0 commit comments