5

我在 Symfony2 包(2.2.2 版)中的 Behat (2.4.*@dev) 初始化进程遇到了一些问题。命令后:

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

问题出在哪里?

4

2 回答 2

2

不确定 Behat v2.4,但对于 Behat v3.0,将包添加到 behat.yml 的“套件”指令中:

# behat.yml
default:
  suites:
    company_app_suite:
      type: symfony_bundle
      bundle: CompanyAppBundle
  extensions:
    Behat\Symfony2Extension: ~
于 2014-12-05T12:14:24.273 回答
0

Either Behat can't find your configuration, try specifying it like so:

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

Or you haven't enabled the Symfony2Extension in your (default) configuration, try specifying it like so:

default:
    extensions:
        Behat\Symfony2Extension\Extension:
于 2014-02-03T09:20:53.563 回答