$product->
setLabel('My special product'
);
$cart =
$service->
getCart($token,
$context);
$service->
add($cart,
$product,
$context);
$actualProduct =
$cart->
get($product->
getId());
static::
assertInstanceOf(LineItem::
class,
$actualProduct);
static::
assertEquals($quantityExpected,
$actualProduct->
getQuantity());
if ($errorKey !== null
) { $error =
$service->
getCart($token,
$context)->
getErrors()->
first();
static::
assertNotNull($error);
static::
assertEquals($errorKey,
$error->
getMessageKey());
} } /**
* @return array<string, array{0: int, 1: int, 2: int, 3: int, 4: int, 5: string}>
*/
public static function productDeliverabilityProvider(): array
{ return [ 'fixed quantity should be return 2' =>
[2, 2, 20, 3, 2, self::PURCHASE_STEP_QUANTITY_ERROR_KEY
],
'fixed quantity should be return 4' =>
[2, 2, 20, 5, 4, self::PURCHASE_STEP_QUANTITY_ERROR_KEY
],