File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
app/code/Magento/GroupedProduct
Test/Unit/Ui/DataProvider/Product/Form/Modifier
Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 20
20
use Magento \Catalog \Helper \Image as ImageHelper ;
21
21
use Magento \Eav \Api \AttributeSetRepositoryInterface ;
22
22
use Magento \Eav \Api \Data \AttributeSetInterface ;
23
+ use Magento \Store \Api \Data \StoreInterface ;
23
24
24
25
/**
25
26
* Class GroupedTest
@@ -75,6 +76,11 @@ class GroupedTest extends AbstractModifierTest
75
76
*/
76
77
protected $ attributeSetRepositoryMock ;
77
78
79
+ /**
80
+ * @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject
81
+ */
82
+ protected $ storeMock ;
83
+
78
84
79
85
protected function setUp ()
80
86
{
@@ -137,9 +143,15 @@ protected function setUp()
137
143
->method ('get ' )
138
144
->with (self ::LINKED_PRODUCT_SKU )
139
145
->willReturn ($ this ->linkedProductMock );
146
+ $ this ->storeMock = $ this ->getMockBuilder (StoreInterface::class)
147
+ ->setMethods (['getId ' ])
148
+ ->getMockForAbstractClass ();
140
149
$ this ->locatorMock ->expects ($ this ->any ())
141
150
->method ('getProduct ' )
142
151
->willReturn ($ this ->productMock );
152
+ $ this ->locatorMock ->expects ($ this ->any ())
153
+ ->method ('getStore ' )
154
+ ->willReturn ($ this ->storeMock );
143
155
}
144
156
145
157
/**
@@ -208,6 +220,9 @@ public function testModifyData()
208
220
],
209
221
],
210
222
],
223
+ 'product ' => [
224
+ 'current_store_id ' => null
225
+ ],
211
226
],
212
227
];
213
228
$ this ->assertSame ($ expectedData , $ this ->getModel ()->modifyData ([]));
Original file line number Diff line number Diff line change @@ -150,7 +150,6 @@ public function modifyData(array $data)
150
150
->getAttributeSetName (),
151
151
];
152
152
}
153
-
154
153
$ data [$ modelId ][self ::DATA_SOURCE_DEFAULT ]['current_store_id ' ] = $ storeId ;
155
154
}
156
155
return $ data ;
You can’t perform that action at this time.
0 commit comments