mariuszgil
mariuszgil

Reputation: 49

Behat and Symfony2 bundle issue?

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?

Upvotes: 5

Views: 620

Answers (2)

Andrew
Andrew

Reputation: 1266

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: ~

Upvotes: 2

Boy Baukema
Boy Baukema

Reputation: 2970

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:

Upvotes: 0

Related Questions