@@ -211,6 +211,7 @@ public function testSubscribeNotLoggedIn()
211211
212212 public function testUpdateSubscription ()
213213 {
214+ $ storeId = 2 ;
214215 $ customerId = 1 ;
215216 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
216217 ->getMock ();
@@ -232,7 +233,7 @@ public function testUpdateSubscription()
232233 ->method ('getConfirmationStatus ' )
233234 ->with ($ customerId )
234235 ->willReturn ('account_confirmation_required ' );
235- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
236+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
236237 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
237238
238239 $ storeModel = $ this ->getMockBuilder (\Magento \Store \Model \Store::class)
@@ -246,6 +247,7 @@ public function testUpdateSubscription()
246247
247248 public function testUnsubscribeCustomerById ()
248249 {
250+ $ storeId = 2 ;
249251 $ customerId = 1 ;
250252 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
251253 ->getMock ();
@@ -263,7 +265,7 @@ public function testUnsubscribeCustomerById()
263265 );
264266 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
265267 $ 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 );
267269 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
268270 $ this ->sendEmailCheck ();
269271
@@ -272,6 +274,7 @@ public function testUnsubscribeCustomerById()
272274
273275 public function testSubscribeCustomerById ()
274276 {
277+ $ storeId = 2 ;
275278 $ customerId = 1 ;
276279 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
277280 ->getMock ();
@@ -289,7 +292,7 @@ public function testSubscribeCustomerById()
289292 );
290293 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
291294 $ 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 );
293296 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
294297 $ this ->sendEmailCheck ();
295298
@@ -298,6 +301,7 @@ public function testSubscribeCustomerById()
298301
299302 public function testSubscribeCustomerById1 ()
300303 {
304+ $ storeId = 2 ;
301305 $ customerId = 1 ;
302306 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
303307 ->getMock ();
@@ -315,7 +319,7 @@ public function testSubscribeCustomerById1()
315319 );
316320 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
317321 $ 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 );
319323 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
320324 $ this ->sendEmailCheck ();
321325 $ this ->customerAccountManagement ->expects ($ this ->once ())
@@ -329,6 +333,7 @@ public function testSubscribeCustomerById1()
329333
330334 public function testSubscribeCustomerByIdAfterConfirmation ()
331335 {
336+ $ storeId = 2 ;
332337 $ customerId = 1 ;
333338 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
334339 ->getMock ();
@@ -346,7 +351,7 @@ public function testSubscribeCustomerByIdAfterConfirmation()
346351 );
347352 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
348353 $ 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 );
350355 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
351356 $ this ->sendEmailCheck ();
352357 $ this ->customerAccountManagement ->expects ($ this ->never ())->method ('getConfirmationStatus ' );
0 commit comments