Sylius\Behat\Page\Shop\Product\ShowPageInterface::addToCartWithVariant PHP Method

addToCartWithVariant() public method

public addToCartWithVariant ( string $variant )
$variant string
    public function addToCartWithVariant($variant);

Usage Example

Example #1
0
 /**
  * @Given I added :variantName variant of product :product to the cart
  * @When I add :variantName variant of product :product to the cart
  * @When I have :variantName variant of product :product in the cart
  * @When /^I add "([^"]+)" variant of (this product) to the cart$/
  */
 public function iAddProductToTheCartSelectingVariant($variantName, ProductInterface $product)
 {
     $this->productShowPage->open(['slug' => $product->getSlug()]);
     $this->productShowPage->addToCartWithVariant($variantName);
     $this->sharedStorage->set('product', $product);
 }