library variadic-extension
Variadic support for behat context arguments
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
Adds variadic arguments support to Behat steps definitions., (*1)
Usage
-
Install it:, (*2)
$ composer require friends-of-behat/variadic-extension --dev
-
Enable it in your Behat configuration:, (*3)
# behat.yml
default:
# ...
extensions:
FriendsOfBehat\VariadicExtension: ~
-
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);
}
}
dev-master
9999999-dev
Variadic support for behat context arguments
Sources
Download
MIT
The Requires
The Development Requires
by
Łukasz Chruściel
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
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
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