Skip to content

Commit 5d5ca5b

Browse files
authored
Add usage example to the README
1 parent 6513d8f commit 5d5ca5b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@ Adds variadic arguments support to Behat steps definitions.
2121
```
2222

2323
3. Boom! :boom: Your Behat contexts are able to use variadic arguments in steps definitions!
24+
25+
```php
26+
/**
27+
* @Given the store has( also) :firstProductName and :secondProductName products
28+
* @Given the store has( also) :firstProductName, :secondProductName and :thirdProductName products
29+
* @Given the store has( also) :firstProductName, :secondProductName, :thirdProductName and :fourthProductName products
30+
*/
31+
public function theStoreHasProducts(...$productsNames)
32+
{
33+
foreach ($productsNames as $productName) {
34+
$this->saveProduct($this->createProduct($productName));
35+
}
36+
}
37+
```

0 commit comments

Comments
 (0)