friends-of-behat/variadic-extension
最新稳定版本:v1.6.0
Composer 安装命令:
composer require friends-of-behat/variadic-extension
包简介
Variadic support for behat context arguments
README 文档
README
Adds variadic arguments support to Behat steps definitions.
Usage
-
Install it:
$ composer require friends-of-behat/variadic-extension --dev
-
Enable it in your Behat configuration:
# behat.yml default: # ... extensions: FriendsOfBehat\VariadicExtension: ~
-
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)); } } /** * @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); } }
统计信息
- 总下载量: 5.71M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 228
- 点击次数: 2
- 依赖项目数: 503
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04