Skip to content

Commit

Permalink
changed method after change of cartContext
Browse files Browse the repository at this point in the history
  • Loading branch information
arti0090 committed Oct 21, 2020
1 parent 827c514 commit 2370522
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Sylius/Behat/Context/Setup/CartContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ public function iAddedProductToTheCart(ProductInterface $product, ?string $token
/**
* @Given /^I have ("[^"]+" variant of this product) in the (cart)$/
*/
public function iHaveVariantOfProductInTheCart(ProductVariantInterface $productVariant, string $tokenValue): void
public function iHaveVariantOfProductInTheCart(ProductVariantInterface $productVariant, ?string $tokenValue): void
{
if ($tokenValue === null) {
$tokenValue = $this->pickupCart();
}

$this->commandBus->dispatch(AddItemToCart::createFromData(
$tokenValue,
$productVariant->getProduct()->getCode(),
Expand Down

0 comments on commit 2370522

Please sign in to comment.