CodeExplorer getProductEntity example
public function testGetProductSeoCategoryShouldReturnMainCategory(): void
{ $categoryIds =
[Uuid::
randomHex()];
$streamIds =
[Uuid::
randomHex()];
$categoryEntity =
new CategoryEntity();
$categoryEntity->
setId($categoryIds[0
]);
$categoryEntity->
setName('category-name-1'
);
$categoryBreadcrumbBuilder =
new CategoryBreadcrumbBuilder($this->
getCategoryRepositoryMock([$categoryEntity],
[$categoryEntity]));
$product =
$this->
getProductEntity($streamIds,
$categoryIds);
$categoryEntity =
$categoryBreadcrumbBuilder->
getProductSeoCategory($product,
$this->context
);
static::
assertNotNull($categoryEntity);
} public function testGetProductSeoCategoryMissingCategoryIdsAndStreamIds(): void
{ $categoryIds =
[];
$streamIds = null;
$categoryEntity =
new CategoryEntity();