@@ -261,22 +261,21 @@ public function testDelete(): void
261
261
public function testDeleteBySkus (): void
262
262
{
263
263
$ categoryId = 42 ;
264
- $ productSku = 'testSku ' ;
265
- $ productId = 55 ;
266
- $ productPositions = [55 => 1 ];
264
+ $ productSkus = ['testSku ' , 'testSku1 ' , 'testSku2 ' , 'testSku3 ' ];
265
+ $ productPositions = [55 => 1 , 56 => 2 , 57 => 3 , 58 => 4 ];
267
266
$ categoryMock = $ this ->createPartialMock (
268
267
Category::class,
269
268
['getProductsPosition ' , 'setPostedProducts ' , 'save ' , 'getId ' ]
270
269
);
271
270
$ this ->categoryRepositoryMock ->expects ($ this ->once ())->method ('get ' )->with ($ categoryId )
272
271
->willReturn ($ categoryMock );
273
272
$ this ->productResourceMock ->expects ($ this ->once ())->method ('getProductsIdsBySkus ' )
274
- ->willReturn (['testSku ' => $ productId ]);
273
+ ->willReturn (['testSku ' => 55 , ' testSku1 ' => 56 , ' testSku2 ' => 57 , ' testSku3 ' => 58 ]);
275
274
$ categoryMock ->expects ($ this ->once ())->method ('getProductsPosition ' )->willReturn ($ productPositions );
276
275
$ categoryMock ->expects ($ this ->once ())->method ('setPostedProducts ' )->with ([]);
277
276
$ categoryMock ->expects ($ this ->once ())->method ('save ' );
278
277
279
- $ this ->assertTrue ($ this ->model ->deleteBySkus ($ categoryId , [ $ productSku ] ));
278
+ $ this ->assertTrue ($ this ->model ->deleteBySkus ($ categoryId , $ productSkus ));
280
279
}
281
280
282
281
/**
0 commit comments