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
Behat "Unrecognized options"
提问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 autoload
section sets the path where Behat looks for context classes. The paths in the suites
section are where the feature definitions (of the default
suite 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 版。