@@ -65,11 +65,6 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase
65
65
*/
66
66
private $ storeManager ;
67
67
68
- /**
69
- * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject
70
- */
71
- private $ registry ;
72
-
73
68
protected function setUp ()
74
69
{
75
70
$ this ->mockContextObject ();
@@ -174,11 +169,6 @@ public function testGetJsonConfig()
174
169
->method ('getId ' )
175
170
->willReturn ($ productId );
176
171
177
- $ this ->registry ->expects ($ this ->any ())
178
- ->method ('registry ' )
179
- ->with ('product ' )
180
- ->willReturn ($ productMock );
181
-
182
172
$ this ->helper ->expects ($ this ->any ())
183
173
->method ('getOptions ' )
184
174
->with ($ productMock , [$ productMock ])
@@ -217,6 +207,8 @@ public function testGetJsonConfig()
217
207
->with ($ expectedArray )
218
208
->willReturn ($ expectedJson );
219
209
210
+ $ this ->block ->setData ('product ' , $ productMock );
211
+
220
212
$ result = $ this ->block ->getJsonConfig ();
221
213
$ this ->assertEquals ($ expectedJson , $ result );
222
214
}
@@ -330,19 +322,12 @@ protected function mockContextObject()
330
322
$ this ->storeManager = $ this ->getMockBuilder (\Magento \Store \Model \StoreManagerInterface::class)
331
323
->getMockForAbstractClass ();
332
324
333
- $ this ->registry = $ this ->getMockBuilder (\Magento \Framework \Registry::class)
334
- ->disableOriginalConstructor ()
335
- ->getMock ();
336
-
337
325
$ this ->context = $ this ->getMockBuilder (\Magento \Catalog \Block \Product \Context::class)
338
326
->disableOriginalConstructor ()
339
327
->getMock ();
340
328
$ this ->context ->expects ($ this ->any ())
341
329
->method ('getStoreManager ' )
342
330
->willReturn ($ this ->storeManager );
343
- $ this ->context ->expects ($ this ->any ())
344
- ->method ('getRegistry ' )
345
- ->willReturn ($ this ->registry );
346
331
}
347
332
348
333
/**
0 commit comments