From d3a85722534cc91f672e58236cedbdaca0c6f4cd Mon Sep 17 00:00:00 2001 From: Andrii Lugovyi Date: Mon, 23 Nov 2015 16:27:25 +0200 Subject: [PATCH] MAGETWO-44971: [GITHUB] Configurable product issues after saving #2226 - fix unit test --- .../Initialization/Helper/Plugin/ConfigurableTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php index 81a73d0f7814e..9bf2341cb9554 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php @@ -23,7 +23,7 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase protected $requestMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \PHPUnit_Framework_MockObject_MockObject | Magento\Catalog\Model\Product */ protected $productMock; @@ -46,6 +46,7 @@ protected function setUp() 'setNewVariationsAttributeSetId', 'setAssociatedProductIds', 'setCanSaveConfigurableAttributes', + 'getTypeId', '__wakeup', ]; $this->productMock = $this->getMock('Magento\Catalog\Model\Product', $methods, [], '', false); @@ -86,6 +87,7 @@ public function testAfterInitializeIfAttributesNotEmptyAndActionNameNotGenerateV $attributes, $this->productMock ); + $this->productMock->expects($this->once())->method('getTypeId')->willReturn('configurable'); $this->productMock->expects($this->once())->method('setNewVariationsAttributeSetId')->with($postValue); $this->productTypeMock->expects( $this->once() @@ -118,6 +120,7 @@ public function testAfterInitializeIfAttributesNotEmptyAndActionNameGenerateVari ['attributes', null, $attributes], ]; $this->requestMock->expects($this->any())->method('getParam')->will($this->returnValueMap($paramValueMap)); + $this->productMock->expects($this->once())->method('getTypeId')->willReturn('configurable'); $this->productTypeMock->expects( $this->once() )->method(