From a1f66c962891aef629cca78c2b6195fc8b2f9f2a Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 10 May 2017 15:43:21 +0300 Subject: [PATCH] MAGETWO-47017: [Github] Add Configurable Product To Cart from Category Page #2574 #5850 #5882 #6572 #5558 #4184 --- .../Product/View/Type/ConfigurableTest.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php index f799047922ae7..37c1659f55870 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php @@ -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(); @@ -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]) @@ -217,6 +207,8 @@ public function testGetJsonConfig() ->with($expectedArray) ->willReturn($expectedJson); + $this->block->setData('product', $productMock); + $result = $this->block->getJsonConfig(); $this->assertEquals($expectedJson, $result); } @@ -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); } /**