Skip to content

Commit

Permalink
MAGETWO-47017: [Github] Add Configurable Product To Cart from Categor…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Semenov committed May 10, 2017
1 parent 2f08a3c commit a1f66c9
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase
*/
private $storeManager;

/**
* @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject
*/
private $registry;

protected function setUp()
{
$this->mockContextObject();
Expand Down Expand Up @@ -174,11 +169,6 @@ public function testGetJsonConfig()
->method('getId')
->willReturn($productId);

$this->registry->expects($this->any())
->method('registry')
->with('product')
->willReturn($productMock);

$this->helper->expects($this->any())
->method('getOptions')
->with($productMock, [$productMock])
Expand Down Expand Up @@ -217,6 +207,8 @@ public function testGetJsonConfig()
->with($expectedArray)
->willReturn($expectedJson);

$this->block->setData('product', $productMock);

$result = $this->block->getJsonConfig();
$this->assertEquals($expectedJson, $result);
}
Expand Down Expand Up @@ -330,19 +322,12 @@ protected function mockContextObject()
$this->storeManager = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)
->getMockForAbstractClass();

$this->registry = $this->getMockBuilder(\Magento\Framework\Registry::class)
->disableOriginalConstructor()
->getMock();

$this->context = $this->getMockBuilder(\Magento\Catalog\Block\Product\Context::class)
->disableOriginalConstructor()
->getMock();
$this->context->expects($this->any())
->method('getStoreManager')
->willReturn($this->storeManager);
$this->context->expects($this->any())
->method('getRegistry')
->willReturn($this->registry);
}

/**
Expand Down

0 comments on commit a1f66c9

Please sign in to comment.