'media' =>
['fileName' => 'foo' .
$i . '_3', 'fileExtension' => 'pdf', 'private' => true
]],
],
]);
} $this->context->
getContext()->
scope(Context::SYSTEM_SCOPE,
function DContext
$context) use ($productPayload): void
{ $this->
getContainer()->
get('product.repository'
)->
create($productPayload,
$context);
});
$this->cart =
new Cart($this->context->
getToken());
foreach ($this->ids->
prefixed('product-state-'
) as $id) { $this->cart->
getLineItems()->
add(new LineItem(Uuid::
randomHex(), LineItem::PRODUCT_LINE_ITEM_TYPE,
$id));
} $this->
getContainer()->
get(ProductCartProcessor::
class)->
collect($this->cart->
getData(),
$this->cart,
$this->context,
new CartBehavior());
} #[Bench\BeforeMethods(['setupWithLogin'])]
#[Bench\Assert('mode(variant.time.avg) < 150ms +/- 20ms')]
public function bench_order_10_physical_products(): void
{ $this->cart->
setLineItems($this->cart->
getLineItems()->
filter(fn (LineItem
$lineItem): bool => \
in_array($lineItem->
getReferencedId(),
$this->ids->
prefixed('product-state-physical-'
), true
)));