定制 friends-of-behat/variadic-extension 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  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));
        }
    }
    
    /**
     * @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

GitHub 信息

  • Stars: 228
  • Watchers: 5
  • Forks: 7
  • 开发语言: Gherkin

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04