$id = Uuid::
randomHex();
$lineItem =
new LineItem($id, LineItem::PRODUCT_LINE_ITEM_TYPE, Uuid::
randomHex(), 1
);
$lineItem->
setStackable(true
);
$cart =
new Cart('test'
);
$this->factory->
expects(static::
once())->
method('supports'
)->
with('product'
)->
willReturn(true
);
$this->eventDispatcher->
expects(static::
never())->
method('dispatch'
);
$this->factory->
expects(static::
once())->
method('update'
)->
with($lineItem,
['id' =>
$id, 'type' => LineItem::PRODUCT_LINE_ITEM_TYPE
],
$this->context
);
$this->service->
updateLineItem($cart,
['id' =>
$id],
$lineItem,
$this->context
);
} public function testUpdateLineItemWithQuantityEvent(): void
{ $id = Uuid::
randomHex();
$lineItem =
new LineItem($id, LineItem::PRODUCT_LINE_ITEM_TYPE, Uuid::
randomHex(), 1
);
$lineItem->
setStackable(true
);
$cart =
new Cart('test'
);
$this->factory->
expects(static::
once())->
method('supports'
)->
with('product'
)->
willReturn(true
);