2017 © Pedro Peláez
 

library variadic-extension

Variadic support for behat context arguments

image

friends-of-behat/variadic-extension

Variadic support for behat context arguments

  • Tuesday, February 13, 2018
  • by pamil
  • Repository
  • 5 Watchers
  • 32 Stars
  • 120,394 Installations
  • Gherkin
  • 79 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 4 Versions
  • 20 % Grown

The README.md

Variadic Extension License Version Build Scrutinizer Quality Score

Adds variadic arguments support to Behat steps definitions., (*1)

Usage

  1. Install it:, (*2)

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

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

    /**
     * @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));
        }
    }
    
    /**
     * @Given /^(this channel) has "([^"]+)", "([^"]+)", "([^"]+)" and "([^"]+)" products$/
     */
    public function thisChannelHasProducts(ChannelInterface $channel, ...$productsNames)
    {
        foreach ($productsNames as $productName) {
            $product = $this->createProduct($productName, 0, $channel);
    
            $this->saveProduct($product);
        }
    }
    

The Versions

13/02 2018

dev-master

9999999-dev

Variadic support for behat context arguments

  Sources   Download

MIT

The Requires

 

The Development Requires

by Łukasz Chruściel

13/02 2018

v1.1.0

1.1.0.0

Variadic support for behat context arguments

  Sources   Download

MIT

The Requires

 

The Development Requires

by Łukasz Chruściel

10/07 2017

v1.0.0

1.0.0.0

Variadic support for behat context arguments

  Sources   Download

MIT

The Requires

 

The Development Requires

by Łukasz Chruściel

26/08 2016

v0.1.0

0.1.0.0

Variadic support for behat context arguments

  Sources   Download

MIT

The Requires

 

The Development Requires

by Łukasz Chruściel