Behat and Symfony2 bundle issue?

大兔子大兔子 提交于 2020-01-03 13:00:34

问题


I've got some problems with Behat (2.4.*@dev) init process inside Symfony2 bundle (ver 2.2.2). After command:

bin/behat --init "@CompanyAppBundle"

behat directories are created inside application root directory, not in bundle. The output is:

+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

Where is the problem?


回答1:


Not sure about Behat v2.4, but for Behat v3.0, add the bundle to the 'suites' directive of behat.yml:

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



回答2:


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:


来源:https://stackoverflow.com/questions/16906745/behat-and-symfony2-bundle-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!