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()
182182 $ quote ->getAddressesCollection ()->walk ('setCustomerId ' , ['customerId ' => null ]);
183183 $ quote ->getAddressesCollection ()->walk ('setEmail ' , ['email ' => null ]);
184184 $ quote ->collectTotals ();
185+ $ quote ->getCustomer ()->setId (null );
185186 $ this ->persistentSession ->getSession ()->removePersistentCookie ();
186187 $ this ->persistentSession ->setSession (null );
187188 $ this ->quoteRepository ->save ($ quote );
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ protected function setUp(): void
134134 'setExtensionAttributes ' ,
135135 '__wakeup ' ,
136136 'setCustomer ' ,
137+ 'getCustomer '
137138 ])
138139 ->disableOriginalConstructor ()
139140 ->getMock ();
@@ -343,6 +344,13 @@ public function testConvertCustomerCartToGuest()
343344 ->method ('setIsPersistent ' )->with (false )->willReturn ($ this ->quoteMock );
344345 $ this ->quoteMock ->expects ($ this ->exactly (3 ))
345346 ->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 );
346354 $ this ->abstractCollectionMock ->expects ($ this ->exactly (3 ))->method ('walk ' )->with (
347355 $ this ->logicalOr (
348356 $ this ->equalTo ('setCustomerAddressId ' ),
You can’t perform that action at this time.
0 commit comments