@@ -213,6 +213,7 @@ public function testSubscribeNotLoggedIn()
213213
214214 public function testUpdateSubscription ()
215215 {
216+ $ storeId = 2 ;
216217 $ customerId = 1 ;
217218 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
218219 ->getMock ();
@@ -234,7 +235,7 @@ public function testUpdateSubscription()
234235 ->method ('getConfirmationStatus ' )
235236 ->with ($ customerId )
236237 ->willReturn ('account_confirmation_required ' );
237- $ customerDataMock ->expects ($ this ->once ( ))->method ('getStoreId ' )->willReturn (' store_id ' );
238+ $ customerDataMock ->expects ($ this ->exactly ( 2 ))->method ('getStoreId ' )->willReturn ($ storeId );
238239 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
239240
240241 $ storeModel = $ this ->getMockBuilder (\Magento \Store \Model \Store::class)
@@ -248,6 +249,7 @@ public function testUpdateSubscription()
248249
249250 public function testUnsubscribeCustomerById ()
250251 {
252+ $ storeId = 2 ;
251253 $ customerId = 1 ;
252254 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
253255 ->getMock ();
@@ -265,7 +267,7 @@ public function testUnsubscribeCustomerById()
265267 );
266268 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
267269 $ 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 );
269271 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
270272 $ this ->sendEmailCheck ();
271273
@@ -274,6 +276,7 @@ public function testUnsubscribeCustomerById()
274276
275277 public function testSubscribeCustomerById ()
276278 {
279+ $ storeId = 2 ;
277280 $ customerId = 1 ;
278281 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
279282 ->getMock ();
@@ -291,7 +294,7 @@ public function testSubscribeCustomerById()
291294 );
292295 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
293296 $ 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 );
295298 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
296299 $ this ->sendEmailCheck ();
297300
@@ -300,6 +303,7 @@ public function testSubscribeCustomerById()
300303
301304 public function testSubscribeCustomerById1 ()
302305 {
306+ $ storeId = 2 ;
303307 $ customerId = 1 ;
304308 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
305309 ->getMock ();
@@ -317,7 +321,7 @@ public function testSubscribeCustomerById1()
317321 );
318322 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
319323 $ 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 );
321325 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
322326 $ this ->sendEmailCheck ();
323327 $ this ->customerAccountManagement ->expects ($ this ->once ())
@@ -331,6 +335,7 @@ public function testSubscribeCustomerById1()
331335
332336 public function testSubscribeCustomerByIdAfterConfirmation ()
333337 {
338+ $ storeId = 2 ;
334339 $ customerId = 1 ;
335340 $ customerDataMock = $ this ->getMockBuilder (\Magento \Customer \Api \Data \CustomerInterface::class)
336341 ->getMock ();
@@ -348,7 +353,7 @@ public function testSubscribeCustomerByIdAfterConfirmation()
348353 );
349354 $ customerDataMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ('id ' );
350355 $ 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 );
352357 $ customerDataMock ->expects ($ this ->once ())->method ('getEmail ' )->willReturn ('email ' );
353358 $ this ->sendEmailCheck ();
354359 $ this ->customerAccountManagement ->expects ($ this ->never ())->method ('getConfirmationStatus ' );
0 commit comments