Behat and Symfony2 bundle issue?


Behat and Symfony2 bundle issue?

我在Symfony2 bundle (ver 2.2.2)中的Behat (2.4.*@dev) init进程中遇到了一些问题。后命令:

bin/behat --init "@CompanyAppBundle"

behat目录创建在应用程序根目录中,而不是在bundle中。输出为:

+d features - place your *.feature files here
+d features/bootstrap - place bootstrap scripts and static files here
+f features/bootstrap/FeatureContext.php - place your feature related code here

问题在哪里?

对于Behat v2.4不确定,但是对于Behat v3.0,将bundle添加到Behat .yml的'suites'指令中:

# behat.yml
default:
  suites:
    company_app_suite:
      type: symfony_bundle
      bundle: CompanyAppBundle
  extensions:
    Behat'Symfony2Extension: ~

如果Behat找不到您的配置,请尝试这样指定:

bin/behat -c alternative/location/to/behat.yml --init "@CompanyAppBundle"

或者您没有在(默认)配置中启用Symfony2Extension,请尝试这样指定它:

default:
    extensions:
        Behat'Symfony2Extension'Extension: