@@ -245,8 +245,8 @@ public function testConvertCustomerCartToGuest()
245
245
$ emailArgs = ['email ' => null ];
246
246
247
247
$ this ->checkoutSessionMock ->expects ($ this ->once ())
248
- ->method ('getQuote ' )->willReturn ($ this -> quoteMock );
249
- $ this ->quoteMock ->expects ($ this ->exactly ( 2 ))->method ('getId ' )->willReturn ($ quoteId );
248
+ ->method ('getQuoteId ' )->willReturn ($ quoteId );
249
+ $ this ->quoteMock ->expects ($ this ->once ( ))->method ('getId ' )->willReturn ($ quoteId );
250
250
$ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('get ' )->with ($ quoteId )->willReturn ($ this ->quoteMock );
251
251
$ this ->quoteMock ->expects ($ this ->once ())
252
252
->method ('setIsActive ' )->with (true )->willReturn ($ this ->quoteMock );
@@ -286,21 +286,19 @@ public function testConvertCustomerCartToGuest()
286
286
public function testConvertCustomerCartToGuestWithEmptyQuote ()
287
287
{
288
288
$ this ->checkoutSessionMock ->expects ($ this ->once ())
289
- ->method ('getQuote ' )->willReturn ($ this ->quoteMock );
290
- $ this ->quoteMock ->expects ($ this ->once ())->method ('getId ' )->willReturn (null );
289
+ ->method ('getQuoteId ' )->willReturn (null );
291
290
$ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('get ' )->with (null )->willReturn (null );
292
-
293
291
$ this ->model ->convertCustomerCartToGuest ();
294
292
}
295
293
296
294
public function testConvertCustomerCartToGuestWithEmptyQuoteId ()
297
295
{
298
296
$ this ->checkoutSessionMock ->expects ($ this ->once ())
299
- ->method ('getQuote ' )->willReturn ($ this ->quoteMock );
300
- $ this ->quoteMock ->expects ($ this ->once ())->method ('getId ' )->willReturn (1 );
297
+ ->method ('getQuoteId ' )->willReturn (1 );
301
298
$ quoteWithNoId = $ this ->quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
302
299
$ quoteWithNoId ->expects ($ this ->once ())->method ('getId ' )->willReturn (null );
303
300
$ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('get ' )->with (1 )->willReturn ($ quoteWithNoId );
301
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getId ' )->willReturn (1 );
304
302
$ this ->model ->convertCustomerCartToGuest ();
305
303
}
306
304
}
0 commit comments