Skip to content

Commit 9d5c396

Browse files
committed
MC-21456: Storefront: Product view in a category
1 parent d962c0e commit 9d5c396

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/ProductInCategoriesViewTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function productVisibilityProvider(): array
169169
public function testAnchorCategoryProductVisibility(): void
170170
{
171171
$this->updateCategoryIsAnchor(400, true);
172-
$this->assignProductCategories(['simple2'], [402]);
172+
$this->assignProductCategories('simple2', [402]);
173173
$parentCategoryCollection = $this->getCategoryProductCollection(400);
174174
$childCategoryCollection = $this->getCategoryProductCollection(402, true);
175175

@@ -188,7 +188,7 @@ public function testAnchorCategoryProductVisibility(): void
188188
public function testNonAnchorCategoryProductVisibility(): void
189189
{
190190
$this->updateCategoryIsAnchor(400, false);
191-
$this->assignProductCategories(['simple2'], [402]);
191+
$this->assignProductCategories('simple2', [402]);
192192
$parentCategoryCollectionSize = $this->getCategoryProductCollection(400)->getSize();
193193
$childCategoryCollectionSize = $this->getCategoryProductCollection(402, true)->getSize();
194194

@@ -223,12 +223,13 @@ public function testCategoryProductViewOnMultiWebsite(): void
223223
/**
224224
* Set categories to the products
225225
*
226-
* @param array $skus
226+
* @param string|array $sku
227227
* @param $categoryIds
228228
* @return void
229229
*/
230-
private function assignProductCategories(array $skus, array $categoryIds): void
230+
private function assignProductCategories($sku, array $categoryIds): void
231231
{
232+
$skus = !is_array($sku) ? [$sku] : $sku;
232233
foreach ($skus as $sku) {
233234
$product = $this->productRepository->get($sku);
234235
$product->setCategoryIds($categoryIds);

0 commit comments

Comments
 (0)