Skip to content

Commit 14c63ff

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-49201: Grouped and Bundle product fixes
1 parent 42693c2 commit 14c63ff

File tree

2 files changed

+15
-1
lines changed
  • app/code/Magento/GroupedProduct

2 files changed

+15
-1
lines changed

app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GroupedTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Magento\Catalog\Helper\Image as ImageHelper;
2121
use Magento\Eav\Api\AttributeSetRepositoryInterface;
2222
use Magento\Eav\Api\Data\AttributeSetInterface;
23+
use Magento\Store\Api\Data\StoreInterface;
2324

2425
/**
2526
* Class GroupedTest
@@ -75,6 +76,11 @@ class GroupedTest extends AbstractModifierTest
7576
*/
7677
protected $attributeSetRepositoryMock;
7778

79+
/**
80+
* @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject
81+
*/
82+
protected $storeMock;
83+
7884

7985
protected function setUp()
8086
{
@@ -137,9 +143,15 @@ protected function setUp()
137143
->method('get')
138144
->with(self::LINKED_PRODUCT_SKU)
139145
->willReturn($this->linkedProductMock);
146+
$this->storeMock = $this->getMockBuilder(StoreInterface::class)
147+
->setMethods(['getId'])
148+
->getMockForAbstractClass();
140149
$this->locatorMock->expects($this->any())
141150
->method('getProduct')
142151
->willReturn($this->productMock);
152+
$this->locatorMock->expects($this->any())
153+
->method('getStore')
154+
->willReturn($this->storeMock);
143155
}
144156

145157
/**
@@ -208,6 +220,9 @@ public function testModifyData()
208220
],
209221
],
210222
],
223+
'product' => [
224+
'current_store_id' => null
225+
],
211226
],
212227
];
213228
$this->assertSame($expectedData, $this->getModel()->modifyData([]));

app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public function modifyData(array $data)
150150
->getAttributeSetName(),
151151
];
152152
}
153-
154153
$data[$modelId][self::DATA_SOURCE_DEFAULT]['current_store_id'] = $storeId;
155154
}
156155
return $data;

0 commit comments

Comments
 (0)