@@ -224,11 +224,12 @@ public function testAddProductCategoriesFilter()
224224 public function testAddMediaGalleryData ()
225225 {
226226 $ attributeId = 42 ;
227- $ itemId = 4242 ;
228- $ linkField = 'entity_id ' ;
229- $ mediaGalleriesMock = [[$ linkField => $ itemId ]];
227+ $ rowId = 4 ;
228+ $ linkField = 'row_id ' ;
229+ $ mediaGalleriesMock = [[$ linkField => $ rowId ]];
230230 $ itemMock = $ this ->getMockBuilder (\Magento \Catalog \Model \Product::class)
231231 ->disableOriginalConstructor ()
232+ ->setMethods (['getData ' ])
232233 ->getMock ();
233234 $ attributeMock = $ this ->getMockBuilder (\Magento \Eav \Model \Entity \Attribute \AbstractAttribute::class)
234235 ->disableOriginalConstructor ()
@@ -248,13 +249,13 @@ public function testAddMediaGalleryData()
248249 $ this ->galleryResourceMock ->expects ($ this ->once ())->method ('createBatchBaseSelect ' )->willReturn ($ selectMock );
249250 $ attributeMock ->expects ($ this ->once ())->method ('getAttributeId ' )->willReturn ($ attributeId );
250251 $ 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 ]);
253254 $ this ->metadataPoolMock ->expects ($ this ->once ())->method ('getMetadata ' )->willReturn ($ metadataMock );
254255 $ metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ linkField );
255256
256257 $ this ->connectionMock ->expects ($ this ->once ())->method ('fetchAll ' )->with ($ selectMock )->willReturn (
257- [['entity_id ' => $ itemId ]]
258+ [['row_id ' => $ rowId ]]
258259 );
259260 $ this ->galleryReadHandlerMock ->expects ($ this ->once ())->method ('addMediaDataToProduct ' )
260261 ->with ($ itemMock , $ mediaGalleriesMock );
0 commit comments