@@ -159,7 +159,6 @@ public function testAddChild()
159
159
->will (
160
160
$ this ->returnValue ([0 => [1 , 2 , 3 ]])
161
161
);
162
- $ configurable ->expects ($ this ->once ())->method ('__call ' )->with ('setAssociatedProductIds ' , [[1 , 2 , 3 , 999 ]]);
163
162
$ configurable ->expects ($ this ->once ())->method ('save ' );
164
163
165
164
$ this ->assertTrue (true , $ this ->object ->addChild ($ productSku , $ childSku ));
@@ -203,7 +202,7 @@ public function testRemoveChild()
203
202
$ childSku = 'simple_10 ' ;
204
203
205
204
$ product = $ this ->getMockBuilder ('Magento\Catalog\Model\Product ' )
206
- ->setMethods (['getTypeInstance ' , 'save ' , 'getTypeId ' , 'addData ' , '__wakeup ' ])
205
+ ->setMethods (['getTypeInstance ' , 'save ' , 'getTypeId ' , 'addData ' , '__wakeup ' , ' getExtensionAttributes ' ])
207
206
->disableOriginalConstructor ()
208
207
->getMock ();
209
208
@@ -231,7 +230,12 @@ public function testRemoveChild()
231
230
$ productType ->expects ($ this ->once ())->method ('getUsedProducts ' )
232
231
->will ($ this ->returnValue ([$ option ]));
233
232
234
- $ product ->expects ($ this ->once ())->method ('addData ' )->with (['associated_product_ids ' => []]);
233
+ $ extensionAttributesMock = $ this ->getMockBuilder (\Magento \Framework \Api \ExtensionAttributesInterface::class)
234
+ ->disableOriginalConstructor ()
235
+ ->setMethods (['setConfigurableProductLinks ' ])
236
+ ->getMock ();
237
+
238
+ $ product ->expects ($ this ->once ())->method ('getExtensionAttributes ' )->willReturn ($ extensionAttributesMock );
235
239
$ product ->expects ($ this ->once ())->method ('save ' );
236
240
$ this ->assertTrue ($ this ->object ->removeChild ($ productSku , $ childSku ));
237
241
}
0 commit comments