1010use Magento \Customer \Api \Data \CustomerExtensionInterface ;
1111use Magento \Framework \Api \ExtensionAttributesFactory ;
1212use Magento \Newsletter \Model \ResourceModel \Subscriber ;
13- use Magento \Store \Model \Store ;
14- use Magento \Store \Model \StoreManagerInterface ;
1513
1614class CustomerPluginTest extends \PHPUnit \Framework \TestCase
1715{
@@ -55,11 +53,6 @@ class CustomerPluginTest extends \PHPUnit\Framework\TestCase
5553 */
5654 private $ customerMock ;
5755
58- /**
59- * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
60- */
61- private $ storeManagerMock ;
62-
6356 protected function setUp ()
6457 {
6558 $ this ->subscriberFactory = $ this ->getMockBuilder (\Magento \Newsletter \Model \SubscriberFactory::class)
@@ -94,8 +87,6 @@ protected function setUp()
9487 ->setMethods (['getExtensionAttributes ' ])
9588 ->disableOriginalConstructor ()
9689 ->getMockForAbstractClass ();
97- $ this ->storeManagerMock = $ this ->createMock (StoreManagerInterface::class);
98-
9990 $ this ->subscriberFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ this ->subscriber );
10091 $ this ->objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
10192
@@ -105,7 +96,6 @@ protected function setUp()
10596 'subscriberFactory ' => $ this ->subscriberFactory ,
10697 'extensionFactory ' => $ this ->extensionFactoryMock ,
10798 'subscriberResource ' => $ this ->subscriberResourceMock ,
108- 'storeManager ' => $ this ->storeManagerMock ,
10999 ]
110100 );
111101 }
@@ -216,7 +206,6 @@ public function testAfterGetByIdCreatesExtensionAttributesIfItIsNotSet(
216206 ) {
217207 $ subject = $ this ->createMock (\Magento \Customer \Api \CustomerRepositoryInterface::class);
218208 $ subscriber = [$ subscriberStatusKey => $ subscriberStatusValue ];
219- $ this ->prepareStoreData ();
220209
221210 $ this ->extensionFactoryMock ->expects ($ this ->any ())
222211 ->method ('create ' )
@@ -244,7 +233,6 @@ public function testAfterGetByIdSetsIsSubscribedFlagIfItIsNotSet()
244233 {
245234 $ subject = $ this ->createMock (\Magento \Customer \Api \CustomerRepositoryInterface::class);
246235 $ subscriber = ['subscriber_id ' => 1 , 'subscriber_status ' => 1 ];
247- $ this ->prepareStoreData ();
248236
249237 $ this ->customerMock ->expects ($ this ->any ())
250238 ->method ('getExtensionAttributes ' )
@@ -279,17 +267,4 @@ public function afterGetByIdDataProvider()
279267 [null , null , false ],
280268 ];
281269 }
282-
283- /**
284- * Prepare store information
285- *
286- * @return void
287- */
288- private function prepareStoreData ()
289- {
290- $ storeId = 1 ;
291- $ storeMock = $ this ->createMock (Store::class);
292- $ storeMock ->expects ($ this ->any ())->method ('getId ' )->willReturn ($ storeId );
293- $ this ->storeManagerMock ->expects ($ this ->any ())->method ('getStore ' )->willReturn ($ storeMock );
294- }
295270}
0 commit comments