@@ -199,7 +199,11 @@ public function testCreateEmptyCartLoggedInUser()
199
199
->with ($ userId )
200
200
->willReturn ($ customerMock );
201
201
202
- $ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('getActiveForCustomer ' )->with ($ userId );
202
+ $ this ->quoteRepositoryMock
203
+ ->expects ($ this ->once ())
204
+ ->method ('getActiveForCustomer ' )
205
+ ->with ($ userId )
206
+ ->willThrowException (new NoSuchEntityException ());
203
207
204
208
$ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('create ' )->willReturn ($ quoteMock );
205
209
$ quoteMock ->expects ($ this ->any ())->method ('setStoreId ' )->with ($ storeId );
@@ -238,7 +242,7 @@ public function testCreateEmptyCartLoggedInUserException()
238
242
$ this ->quoteRepositoryMock
239
243
->expects ($ this ->once ())
240
244
->method ('getActiveForCustomer ' )
241
- ->willThrowException ( new NoSuchEntityException ( ' 123 ' ) );
245
+ ->with ( $ userId );
242
246
243
247
$ this ->quoteRepositoryMock ->expects ($ this ->never ())->method ('create ' )->willReturn ($ quoteMock );
244
248
@@ -404,8 +408,7 @@ public function testAssignCustomerNoSuchCustomer()
404
408
$ this ->quoteRepositoryMock
405
409
->expects ($ this ->once ())
406
410
->method ('getForCustomer ' )
407
- ->with ($ customerId )
408
- ->willThrowException (new \Magento \Framework \Exception \NoSuchEntityException ());
411
+ ->with ($ customerId );
409
412
410
413
$ this ->model ->assignCustomer ($ cartId , $ customerId , $ storeId );
411
414
}
@@ -461,7 +464,8 @@ public function testAssignCustomer()
461
464
$ this ->quoteRepositoryMock
462
465
->expects ($ this ->once ())
463
466
->method ('getForCustomer ' )
464
- ->with ($ customerId );
467
+ ->with ($ customerId )
468
+ ->willThrowException (new NoSuchEntityException ());
465
469
466
470
$ quoteMock ->expects ($ this ->once ())->method ('setCustomer ' )->with ($ customerMock );
467
471
$ quoteMock ->expects ($ this ->once ())->method ('setCustomerIsGuest ' )->with (0 );
0 commit comments