@@ -510,12 +510,12 @@ public function testAssignCustomerWithActiveCart()
510
510
511
511
$ quoteMock = $ this ->createPartialMock (
512
512
Quote::class,
513
- ['getCustomerId ' , 'setCustomer ' , 'setCustomerIsGuest ' , 'setStoreId ' , ' setIsActive ' , 'getIsActive ' , 'merge ' ]
513
+ ['getCustomerId ' , 'setCustomer ' , 'setCustomerIsGuest ' , 'setIsActive ' , 'getIsActive ' , 'merge ' ]
514
514
);
515
515
516
516
$ activeQuoteMock = $ this ->createPartialMock (
517
517
Quote::class,
518
- ['getCustomerId ' , 'setCustomer ' , 'setCustomerIsGuest ' , 'setStoreId ' , ' setIsActive ' , 'getIsActive ' , 'merge ' ]
518
+ ['getCustomerId ' , 'setCustomer ' , 'setCustomerIsGuest ' , 'setIsActive ' , 'getIsActive ' , 'merge ' ]
519
519
);
520
520
521
521
$ customerMock = $ this ->createMock (CustomerInterface::class);
@@ -556,17 +556,17 @@ public function testAssignCustomerWithActiveCart()
556
556
->willReturn ($ activeQuoteMock );
557
557
558
558
$ quoteMock ->expects ($ this ->once ())->method ('merge ' )->with ($ activeQuoteMock )->willReturnSelf ();
559
- $ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('delete ' )->with ($ activeQuoteMock );
559
+ $ activeQuoteMock ->expects ($ this ->once ())->method ('setIsActive ' )->with (0 );
560
+ $ this ->quoteRepositoryMock ->expects ($ this ->atLeastOnce ())->method ('save ' )->with ($ activeQuoteMock );
560
561
561
562
$ quoteMock ->expects ($ this ->once ())->method ('setCustomer ' )->with ($ customerMock );
562
563
$ quoteMock ->expects ($ this ->once ())->method ('setCustomerIsGuest ' )->with (0 );
563
- $ quoteMock ->expects ($ this ->once ())->method ('setStoreId ' )->with ($ storeId );
564
564
$ quoteMock ->expects ($ this ->once ())->method ('setIsActive ' )->with (1 );
565
565
566
566
$ this ->quoteIdMock ->expects ($ this ->once ())->method ('load ' )->with ($ cartId , 'quote_id ' )->willReturnSelf ();
567
567
$ this ->quoteIdMock ->expects ($ this ->once ())->method ('getId ' )->willReturn (10 );
568
568
$ this ->quoteIdMock ->expects ($ this ->once ())->method ('delete ' );
569
- $ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('save ' )->with ($ quoteMock );
569
+ $ this ->quoteRepositoryMock ->expects ($ this ->atLeastOnce ())->method ('save ' )->with ($ quoteMock );
570
570
571
571
$ this ->model ->assignCustomer ($ cartId , $ customerId , $ storeId );
572
572
}
@@ -585,7 +585,7 @@ public function testAssignCustomer()
585
585
586
586
$ quoteMock = $ this ->createPartialMock (
587
587
Quote::class,
588
- ['getCustomerId ' , 'setCustomer ' , 'setCustomerIsGuest ' , 'setStoreId ' , ' setIsActive ' , 'getIsActive ' , 'merge ' ]
588
+ ['getCustomerId ' , 'setCustomer ' , 'setCustomerIsGuest ' , 'setIsActive ' , 'getIsActive ' , 'merge ' ]
589
589
);
590
590
591
591
$ customerMock = $ this ->createMock (CustomerInterface::class);
@@ -629,11 +629,9 @@ public function testAssignCustomer()
629
629
630
630
$ this ->assertEquals (false , $ activeQuoteMock );
631
631
$ quoteMock ->expects ($ this ->never ())->method ('merge ' );
632
- $ this ->quoteRepositoryMock ->expects ($ this ->never ())->method ('delete ' );
633
632
634
633
$ quoteMock ->expects ($ this ->once ())->method ('setCustomer ' )->with ($ customerMock );
635
634
$ quoteMock ->expects ($ this ->once ())->method ('setCustomerIsGuest ' )->with (0 );
636
- $ quoteMock ->expects ($ this ->once ())->method ('setStoreId ' )->with ($ storeId );
637
635
$ quoteMock ->expects ($ this ->once ())->method ('setIsActive ' )->with (1 );
638
636
639
637
$ this ->quoteIdMock ->expects ($ this ->once ())->method ('load ' )->with ($ cartId , 'quote_id ' )->willReturnSelf ();
0 commit comments