[英]How to change the Symfony2 Behat Bundle default Feature context file (FeatureContext.php by default)
我使用Symfony2 BehatBundle ,版本= v1.0.0,并且我想更改主要功能上下文文件的名称 。 现在,当我使用命令运行behat时:
app/console --env=test behat @NameOfMyBundle
使用文件src / NameOfMyBundle / Features / Context / FeatureContext.php
我想使用自定义的主要功能文件,例如src / NameOfMyBundle / Features / Context / MyCustomContext.php,但我不知道如何。 根据behat文档 :
按照约定,上下文类应称为FeatureContext,但这可以通过cli配置轻松更改。
但是,找不到此配置选项。 我尝试了类似的东西:
app/console --env=test behat @NameOfMyBundle --context "MyCustomContext"
但是失败了。
有谁知道如何更改此主要功能上下文文件(最好使用cli)?
谢谢!
可以在配置文件中更改上下文类: http : //docs.behat.org/guides/7.config.html#context
也可以使用环境变量: http : //docs.behat.org/guides/7.config.html#environment-variable
该捆绑包不再维护。 请改用扩展程序: http : //docs.behat.org/en/latest/cookbooks/1.symfony2_integration.html#installing-and-enabling-symfony2-extension
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.