Skip to content

Commit a1f66c9

Browse files
author
Sergey Semenov
committed
MAGETWO-47017: [Github] Add Configurable Product To Cart from Category Page #2574 #5850 #5882 #6572 #5558 #4184
1 parent 2f08a3c commit a1f66c9

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase
6565
*/
6666
private $storeManager;
6767

68-
/**
69-
* @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject
70-
*/
71-
private $registry;
72-
7368
protected function setUp()
7469
{
7570
$this->mockContextObject();
@@ -174,11 +169,6 @@ public function testGetJsonConfig()
174169
->method('getId')
175170
->willReturn($productId);
176171

177-
$this->registry->expects($this->any())
178-
->method('registry')
179-
->with('product')
180-
->willReturn($productMock);
181-
182172
$this->helper->expects($this->any())
183173
->method('getOptions')
184174
->with($productMock, [$productMock])
@@ -217,6 +207,8 @@ public function testGetJsonConfig()
217207
->with($expectedArray)
218208
->willReturn($expectedJson);
219209

210+
$this->block->setData('product', $productMock);
211+
220212
$result = $this->block->getJsonConfig();
221213
$this->assertEquals($expectedJson, $result);
222214
}
@@ -330,19 +322,12 @@ protected function mockContextObject()
330322
$this->storeManager = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)
331323
->getMockForAbstractClass();
332324

333-
$this->registry = $this->getMockBuilder(\Magento\Framework\Registry::class)
334-
->disableOriginalConstructor()
335-
->getMock();
336-
337325
$this->context = $this->getMockBuilder(\Magento\Catalog\Block\Product\Context::class)
338326
->disableOriginalConstructor()
339327
->getMock();
340328
$this->context->expects($this->any())
341329
->method('getStoreManager')
342330
->willReturn($this->storeManager);
343-
$this->context->expects($this->any())
344-
->method('getRegistry')
345-
->willReturn($this->registry);
346331
}
347332

348333
/**

0 commit comments

Comments
 (0)