Skip to content

Commit 19fe0df

Browse files
committed
Fix the Newsletter subscriber unit test so that it mocks the store manager correctly
1 parent 81725aa commit 19fe0df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ public function testUpdateSubscription()
187187
$customerDataMock->expects($this->once())->method('getStoreId')->willReturn('store_id');
188188
$customerDataMock->expects($this->once())->method('getEmail')->willReturn('email');
189189

190+
$storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class)
191+
->disableOriginalConstructor()
192+
->setMethods(['getId'])
193+
->getMock();
194+
$this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel);
195+
190196
$this->assertEquals($this->subscriber, $this->subscriber->updateSubscription($customerId));
191197
}
192198

0 commit comments

Comments
 (0)