/**
* @return array{products: array{product-with-category: string, testable-product: string, variant-testable-product: string}, categories: list<string>}
*/
private function prepareData(): array
{ $ids =
new IdsCollection();
$products =
[];
$name = 'product-with-category';
$builder =
new ProductBuilder($ids,
$name);
$builder->
price(200
) ->
categories(['cat1', 'cat2'
]) ->
write($this->
getContainer());
/** @var array{id: string, children: array<int, array{id: string}>, categories: array<int, array{id: string, name:string}>} $product */
$product =
$builder->
build();
$products[$name] =
$product['id'
];
/** @var list<string> $categories */
$categories = \
array_column($product['categories'
], 'id'
);
\
sort($categories);
$name = 'testable-product';
$builder =
new ProductBuilder($ids,
$name);