问题
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