• Stars
    star
    226
  • Rank 175,985 (Top 4 %)
  • Language Gherkin
  • License
    MIT License
  • Created about 8 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍺 Extension adding variadic arguments support to Behat steps definitions

Variadic Extension License Version Build Scrutinizer Quality Score

Adds variadic arguments support to Behat steps definitions.

Usage

  1. Install it:

    $ composer require friends-of-behat/variadic-extension --dev
  2. Enable it in your Behat configuration:

    # behat.yml
    default:
        # ...
        extensions:
            FriendsOfBehat\VariadicExtension: ~
  3. You can use variadic arguments in steps definitions!

    /**
     * @Given the store has( also) :firstProductName and :secondProductName products
     * @Given the store has( also) :firstProductName, :secondProductName and :thirdProductName products
     * @Given the store has( also) :firstProductName, :secondProductName, :thirdProductName and :fourthProductName products
     */
    public function theStoreHasProducts(...$productsNames)
    {
        foreach ($productsNames as $productName) {
            $this->saveProduct($this->createProduct($productName));
        }
    }