@@ -224,11 +224,12 @@ public function testAddProductCategoriesFilter()
224
224
public function testAddMediaGalleryData ()
225
225
{
226
226
$ attributeId = 42 ;
227
- $ itemId = 4242 ;
228
- $ linkField = 'entity_id ' ;
229
- $ mediaGalleriesMock = [[$ linkField => $ itemId ]];
227
+ $ rowId = 4 ;
228
+ $ linkField = 'row_id ' ;
229
+ $ mediaGalleriesMock = [[$ linkField => $ rowId ]];
230
230
$ itemMock = $ this ->getMockBuilder (\Magento \Catalog \Model \Product::class)
231
231
->disableOriginalConstructor ()
232
+ ->setMethods (['getData ' ])
232
233
->getMock ();
233
234
$ attributeMock = $ this ->getMockBuilder (\Magento \Eav \Model \Entity \Attribute \AbstractAttribute::class)
234
235
->disableOriginalConstructor ()
@@ -248,13 +249,13 @@ public function testAddMediaGalleryData()
248
249
$ this ->galleryResourceMock ->expects ($ this ->once ())->method ('createBatchBaseSelect ' )->willReturn ($ selectMock );
249
250
$ attributeMock ->expects ($ this ->once ())->method ('getAttributeId ' )->willReturn ($ attributeId );
250
251
$ this ->entityMock ->expects ($ this ->once ())->method ('getAttribute ' )->willReturn ($ attributeMock );
251
- $ itemMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ($ itemId );
252
- $ selectMock ->expects ($ this ->once ())->method ('where ' )->with ('entity. ' . $ linkField . ' IN (?) ' , [$ itemId ]);
252
+ $ itemMock ->expects ($ this ->atLeastOnce ())->method ('getData ' )->willReturn ($ rowId );
253
+ $ selectMock ->expects ($ this ->once ())->method ('where ' )->with ('entity. ' . $ linkField . ' IN (?) ' , [$ rowId ]);
253
254
$ this ->metadataPoolMock ->expects ($ this ->once ())->method ('getMetadata ' )->willReturn ($ metadataMock );
254
255
$ metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ linkField );
255
256
256
257
$ this ->connectionMock ->expects ($ this ->once ())->method ('fetchAll ' )->with ($ selectMock )->willReturn (
257
- [['entity_id ' => $ itemId ]]
258
+ [['row_id ' => $ rowId ]]
258
259
);
259
260
$ this ->galleryReadHandlerMock ->expects ($ this ->once ())->method ('addMediaDataToProduct ' )
260
261
->with ($ itemMock , $ mediaGalleriesMock );
0 commit comments