@@ -211,6 +211,7 @@ public function testSubscribeNotLoggedIn()
211
211
212
212
public function testUpdateSubscription ()
213
213
{
214
+ $ storeId = 2 ;
214
215
$ customerId = 1 ;
215
216
$ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
216
217
->getMock ();
@@ -232,7 +233,7 @@ public function testUpdateSubscription()
232
233
->method ('getConfirmationStatus ' )
233
234
->with ($ customerId )
234
235
->willReturn ('account_confirmation_required ' );
235
- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
236
+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
236
237
$ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
237
238
238
239
$ storeModel = $ this ->getMockBuilder (\Magento \Store \Model \Store::class)
@@ -246,6 +247,7 @@ public function testUpdateSubscription()
246
247
247
248
public function testUnsubscribeCustomerById ()
248
249
{
250
+ $ storeId = 2 ;
249
251
$ customerId = 1 ;
250
252
$ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
251
253
->getMock ();
@@ -263,7 +265,7 @@ public function testUnsubscribeCustomerById()
263
265
);
264
266
$ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
265
267
$ this ->resource ->expects ($ this ->atLeastOnce ())->method ('save ' )->willReturnSelf ();
266
- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
268
+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
267
269
$ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
268
270
$ this ->sendEmailCheck ();
269
271
@@ -272,6 +274,7 @@ public function testUnsubscribeCustomerById()
272
274
273
275
public function testSubscribeCustomerById ()
274
276
{
277
+ $ storeId = 2 ;
275
278
$ customerId = 1 ;
276
279
$ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
277
280
->getMock ();
@@ -289,7 +292,7 @@ public function testSubscribeCustomerById()
289
292
);
290
293
$ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
291
294
$ this ->resource ->expects ($ this ->atLeastOnce ())->method ('save ' )->willReturnSelf ();
292
- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
295
+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
293
296
$ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
294
297
$ this ->sendEmailCheck ();
295
298
@@ -298,6 +301,7 @@ public function testSubscribeCustomerById()
298
301
299
302
public function testSubscribeCustomerById1 ()
300
303
{
304
+ $ storeId = 2 ;
301
305
$ customerId = 1 ;
302
306
$ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
303
307
->getMock ();
@@ -315,7 +319,7 @@ public function testSubscribeCustomerById1()
315
319
);
316
320
$ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
317
321
$ this ->resource ->expects ($ this ->atLeastOnce ())->method ('save ' )->willReturnSelf ();
318
- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
322
+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
319
323
$ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
320
324
$ this ->sendEmailCheck ();
321
325
$ this ->customerAccountManagement ->expects ($ this ->once ())
@@ -329,6 +333,7 @@ public function testSubscribeCustomerById1()
329
333
330
334
public function testSubscribeCustomerByIdAfterConfirmation ()
331
335
{
336
+ $ storeId = 2 ;
332
337
$ customerId = 1 ;
333
338
$ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
334
339
->getMock ();
@@ -346,7 +351,7 @@ public function testSubscribeCustomerByIdAfterConfirmation()
346
351
);
347
352
$ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
348
353
$ this ->resource ->expects ($ this ->atLeastOnce ())->method ('save ' )->willReturnSelf ();
349
- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
354
+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
350
355
$ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
351
356
$ this ->sendEmailCheck ();
352
357
$ this ->customerAccountManagement ->expects ($ this ->never ())->method ('getConfirmationStatus ' );
0 commit comments