@@ -47,6 +47,7 @@ protected function setUp()
47
47
'save ' ,
48
48
'getShippingAddress ' ,
49
49
'getCouponCode ' ,
50
+ 'getStoreId ' ,
50
51
'__wakeup '
51
52
]);
52
53
$ this ->quoteAddressMock = $ this ->createPartialMock (\Magento \Quote \Model \Quote \Address::class, [
@@ -98,6 +99,9 @@ public function testSetWhenCouldNotApplyCoupon()
98
99
$ cartId = 33 ;
99
100
$ couponCode = '153a-ABC ' ;
100
101
102
+ $ this ->storeMock ->expects ($ this ->any ())->method ('getId ' )->will ($ this ->returnValue (1 ));
103
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getStoreId ' )->willReturn ($ this ->returnValue (1 ));
104
+
101
105
$ this ->quoteRepositoryMock ->expects ($ this ->once ())
102
106
->method ('getActive ' )->with ($ cartId )->will ($ this ->returnValue ($ this ->quoteMock ));
103
107
$ this ->quoteMock ->expects ($ this ->once ())->method ('getItemsCount ' )->will ($ this ->returnValue (12 ));
@@ -125,6 +129,9 @@ public function testSetWhenCouponCodeIsInvalid()
125
129
$ cartId = 33 ;
126
130
$ couponCode = '153a-ABC ' ;
127
131
132
+ $ this ->storeMock ->expects ($ this ->any ())->method ('getId ' )->will ($ this ->returnValue (1 ));
133
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getStoreId ' )->willReturn ($ this ->returnValue (1 ));
134
+
128
135
$ this ->quoteRepositoryMock ->expects ($ this ->once ())
129
136
->method ('getActive ' )->with ($ cartId )->will ($ this ->returnValue ($ this ->quoteMock ));
130
137
$ this ->quoteMock ->expects ($ this ->once ())->method ('getItemsCount ' )->will ($ this ->returnValue (12 ));
@@ -144,6 +151,9 @@ public function testSet()
144
151
$ cartId = 33 ;
145
152
$ couponCode = '153a-ABC ' ;
146
153
154
+ $ this ->storeMock ->expects ($ this ->any ())->method ('getId ' )->will ($ this ->returnValue (1 ));
155
+ $ this ->quoteMock ->expects ($ this ->once ())->method ('getStoreId ' )->willReturn ($ this ->returnValue (1 ));
156
+
147
157
$ this ->quoteRepositoryMock ->expects ($ this ->once ())
148
158
->method ('getActive ' )->with ($ cartId )->will ($ this ->returnValue ($ this ->quoteMock ));
149
159
$ this ->quoteMock ->expects ($ this ->once ())->method ('getItemsCount ' )->will ($ this ->returnValue (12 ));
0 commit comments