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