@@ -158,7 +158,7 @@ public function testAddChild()
158
158
->getMock ();
159
159
$ optionMock = $ this ->getMockBuilder (\Magento \ConfigurableProduct \Api \Data \Option::class)
160
160
->disableOriginalConstructor ()
161
- ->setMethods (['getProductAttribute ' , 'getAttributeId ' ])
161
+ ->setMethods (['getProductAttribute ' , 'getPosition ' , ' getAttributeId ' ])
162
162
->getMock ();
163
163
$ productAttributeMock = $ this ->getMockBuilder (\Magento \Eav \Model \Entity \Attribute \AbstractAttribute::class)
164
164
->disableOriginalConstructor ()
@@ -216,13 +216,15 @@ public function testAddChild()
216
216
$ productAttributeMock ->expects ($ this ->any ())->method ('getAttributeCode ' )->willReturn ('color ' );
217
217
$ simple ->expects ($ this ->any ())->method ('getData ' )->willReturn ('color ' );
218
218
$ optionMock ->expects ($ this ->any ())->method ('getAttributeId ' )->willReturn ('1 ' );
219
+ $ optionMock ->expects ($ this ->any ())->method ('getPosition ' )->willReturn ('0 ' );
219
220
220
221
$ optionsFactoryMock ->expects ($ this ->any ())->method ('create ' )->willReturn ([$ optionMock ]);
221
222
$ attributeFactoryMock ->expects ($ this ->any ())->method ('create ' )->willReturn ($ attributeMock );
222
223
$ attributeMock ->expects ($ this ->any ())->method ('getCollection ' )->willReturn ($ attributeCollectionMock );
223
224
$ attributeCollectionMock ->expects ($ this ->any ())->method ('addFieldToFilter ' )->willReturnSelf ();
224
225
$ attributeCollectionMock ->expects ($ this ->any ())->method ('getItems ' )->willReturn ([$ attributeMock ]);
225
226
227
+ $ attributeMock ->expects ($ this ->any ())->method ('getId ' )->willReturn (1 );
226
228
$ attributeMock ->expects ($ this ->any ())->method ('getOptions ' )->willReturn ([$ attributeOptionMock ]);
227
229
228
230
$ extensionAttributesMock ->expects ($ this ->any ())->method ('setConfigurableProductOptions ' );
0 commit comments