10
10
use Magento \Customer \Api \Data \CustomerExtensionInterface ;
11
11
use Magento \Framework \Api \ExtensionAttributesFactory ;
12
12
use Magento \Newsletter \Model \ResourceModel \Subscriber ;
13
- use Magento \Store \Model \Store ;
14
- use Magento \Store \Model \StoreManagerInterface ;
15
13
16
14
class CustomerPluginTest extends \PHPUnit \Framework \TestCase
17
15
{
@@ -55,11 +53,6 @@ class CustomerPluginTest extends \PHPUnit\Framework\TestCase
55
53
*/
56
54
private $ customerMock ;
57
55
58
- /**
59
- * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
60
- */
61
- private $ storeManagerMock ;
62
-
63
56
protected function setUp ()
64
57
{
65
58
$ this ->subscriberFactory = $ this ->getMockBuilder (\Magento \Newsletter \Model \SubscriberFactory::class)
@@ -94,8 +87,6 @@ protected function setUp()
94
87
->setMethods (['getExtensionAttributes ' ])
95
88
->disableOriginalConstructor ()
96
89
->getMockForAbstractClass ();
97
- $ this ->storeManagerMock = $ this ->createMock (StoreManagerInterface::class);
98
-
99
90
$ this ->subscriberFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ this ->subscriber );
100
91
$ this ->objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
101
92
@@ -105,7 +96,6 @@ protected function setUp()
105
96
'subscriberFactory ' => $ this ->subscriberFactory ,
106
97
'extensionFactory ' => $ this ->extensionFactoryMock ,
107
98
'subscriberResource ' => $ this ->subscriberResourceMock ,
108
- 'storeManager ' => $ this ->storeManagerMock ,
109
99
]
110
100
);
111
101
}
@@ -216,7 +206,6 @@ public function testAfterGetByIdCreatesExtensionAttributesIfItIsNotSet(
216
206
) {
217
207
$ subject = $ this ->createMock (\Magento \Customer \Api \CustomerRepositoryInterface::class);
218
208
$ subscriber = [$ subscriberStatusKey => $ subscriberStatusValue ];
219
- $ this ->prepareStoreData ();
220
209
221
210
$ this ->extensionFactoryMock ->expects ($ this ->any ())
222
211
->method ('create ' )
@@ -244,7 +233,6 @@ public function testAfterGetByIdSetsIsSubscribedFlagIfItIsNotSet()
244
233
{
245
234
$ subject = $ this ->createMock (\Magento \Customer \Api \CustomerRepositoryInterface::class);
246
235
$ subscriber = ['subscriber_id ' => 1 , 'subscriber_status ' => 1 ];
247
- $ this ->prepareStoreData ();
248
236
249
237
$ this ->customerMock ->expects ($ this ->any ())
250
238
->method ('getExtensionAttributes ' )
@@ -279,17 +267,4 @@ public function afterGetByIdDataProvider()
279
267
[null , null , false ],
280
268
];
281
269
}
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
- }
295
270
}
0 commit comments