public function testAddProduct(string
$input, ?string
$expected): void
{ $context =
$this->
getContainer()->
get(SalesChannelContextFactory::
class) ->
create(Uuid::
randomHex(), TestDefaults::SALES_CHANNEL,
[]);
$hook =
new CartHook($this->
createCart(),
$context);
$service =
$this->
getContainer()->
get(CartFacadeHookFactory::
class) ->
factory($hook,
$this->script
);
$service->
products()->
add($this->ids->
get($input));
$service->
calculate();
$item =
$service->
products()->
get($this->ids->
get($input));
if ($expected === null
) { static::
assertNull($item);
return;
} static::
assertInstanceOf(ItemFacade::
class,
$item);