Skip to content

Commit f4fc5b9

Browse files
author
mastuhin.olexnadr
committed
ENGCOM-1103: [Forwardport] Category\Collection::joinUrlRewrite should use the store set on the collection #14381
1 parent e18f09a commit f4fc5b9

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

dev/tests/integration/testsuite/Magento/Bundle/Model/Category/ProductIndexerTest.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,28 @@ public function testCategoryCreate()
208208
}
209209

210210
/**
211+
* Finds 4 categories
212+
*
211213
* @return Category[]
212214
*/
213215
private function getCategories()
214216
{
215-
/** @var Category $category */
216-
$category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
217-
\Magento\Catalog\Model\Category::class
217+
$collectionFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
218+
\Magento\Catalog\Model\ResourceModel\Category\CollectionFactory::class
218219
);
219220

220-
$result = $category->getCollection()->addAttributeToSelect('name')->getItems();
221-
$result = array_slice($result, 2);
221+
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */
222+
$collection = $collectionFactory->create();
223+
224+
$collection
225+
->addAttributeToSelect('name')
226+
->addAttributeToFilter('name', ['in' => [
227+
'Category 1',
228+
'Category 2',
229+
'Category 3',
230+
'Category 4',
231+
]]);
222232

223-
return array_slice($result, 0, 4);
233+
return array_values($collection->getItems());
224234
}
225235
}

0 commit comments

Comments
 (0)