laravel Behat“无法识别的选项”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20992000/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 08:51:11  来源:igfitidea点击:

Behat "Unrecognized options"

phplaravelbehat

提问by Patrick

I'm trying to run Behat (first time for me) and it worked.

我正在尝试运行 Behat(对我来说是第一次)并且它奏效了。

But i have a configuration problem. I tried to change the paths of features and bootstrap like so:

但我有一个配置问题。我尝试像这样更改功能和引导程序的路径:

#behat.yml
default:
    paths:
        features: app/tests/features
        bootstrap: %behat.paths.features%/bootstrap

Now i'm getting an exception:

现在我得到一个例外:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized options "paths" under "testwork"

What did i do wrong?

我做错了什么?

回答by christopheraue

Behat 3 is out by now. You configure paths as follows:

Behat 3 现已推出。您可以按如下方式配置路径:

#behat.yml
default:
  autoload:
    '': %paths.base%/tests/features/bootstrap
  suites:
    default:
      paths:
        - %paths.base%/tests/features

The path given in the autoloadsection sets the path where Behat looks for context classes. The paths in the suitessection are where the feature definitions (of the defaultsuite in this case) live in.

autoload节中给出的路径设置了 Behat 查找上下文类的路径。该suites部分中的路径是功能定义(default在本例中为套件)所在的位置。

回答by everzet

You're trying to use Behat 3, which is not released yet - use version 2.5 instead.

您正在尝试使用尚未发布的 Behat 3 - 请改用 2.5 版。