19
19
namespace Magento \SalesRule \Test \Unit \Plugin ;
20
20
21
21
use Magento \Quote \Model \Quote ;
22
- use Magento \Quote \Model \ QuoteRepository ;
22
+ use Magento \Quote \Api \ CartRepositoryInterface ;
23
23
use PHPUnit \Framework \MockObject \MockObject ;
24
24
use PHPUnit \Framework \TestCase ;
25
25
use Magento \SalesRule \Model \Coupon \Quote \UpdateCouponUsages ;
@@ -40,9 +40,9 @@ class CouponUsageIncreamentForMultishippingTest extends TestCase
40
40
private $ updateCouponUsagesMock ;
41
41
42
42
/**
43
- * @var QuoteRepository |MockObject
43
+ * @var CartRepositoryInterface |MockObject
44
44
*/
45
- private $ quoteRepositoryMock ;
45
+ private $ cartRepositoryInterfaceMock ;
46
46
47
47
/**
48
48
* @var Order[]|MockObject
@@ -66,7 +66,7 @@ protected function setUp(): void
66
66
->disableOriginalConstructor ()
67
67
->onlyMethods (['execute ' ])
68
68
->getMock ();
69
- $ this ->quoteRepositoryMock = $ this ->getMockBuilder (QuoteRepository ::class)
69
+ $ this ->cartRepositoryInterfaceMock = $ this ->getMockBuilder (CartRepositoryInterface ::class)
70
70
->disableOriginalConstructor ()
71
71
->getMock ();
72
72
$ this ->orderMock = $ this ->getMockBuilder (Order::class)
@@ -75,7 +75,7 @@ protected function setUp(): void
75
75
->getMock ();
76
76
$ this ->plugin = new CouponUsagesIncrementMultishipping (
77
77
$ this ->updateCouponUsagesMock ,
78
- $ this ->quoteRepositoryMock
78
+ $ this ->cartRepositoryInterfaceMock
79
79
);
80
80
}
81
81
/**
@@ -96,7 +96,7 @@ public function testAroundPlace()
96
96
$ this ->orderMock ->expects ($ this ->once ())->method ('getQuoteId ' )
97
97
->willReturn (1 );
98
98
99
- $ this ->quoteRepositoryMock ->expects ($ this ->once ())->method ('get ' )->with (1 )->willReturn ($ quoteMock );
99
+ $ this ->cartRepositoryInterfaceMock ->expects ($ this ->once ())->method ('get ' )->with (1 )->willReturn ($ quoteMock );
100
100
$ quoteMock ->expects ($ this ->once ())->method ('getCouponCode ' )->willReturn ($ couponCode );
101
101
$ quoteMock ->expects ($ this ->any ())->method ('dataHasChangedFor ' )->with ($ couponCode )->willReturn (true );
102
102
$ this ->updateCouponUsagesMock
0 commit comments