How can I run behat --init -s bugfix
to generate Context files inside the Bundle? Is there any way to do this? I see the Sf2DemoBundle
but I didn't solve how it works.
My files
# /composer.json
"behat/behat": "dev-master",
"behat/mink": "dev-master",
"behat/mink-extension": "dev-master",
"behat/symfony2-extension": "dev-master",
"behat/mink-goutte-driver": "dev-master",
"behat/mink-browserkit-driver": "dev-master",
"behat/mink-selenium2-driver": "dev-master",
# /behat.yml
default:
suites:
default:
path: %paths.base%/features
contexts: [Behat\MinkExtension\Context\MinkContext]
bugfix:
type: symfony_bundle
bundle: 'TestBugfixBundle'
contexts: ['TestBugfixBundle\Features\Context\WebContext']
extensions:
Behat\Symfony2Extension: ~
Behat\MinkExtension:
default_session: 'symfony2'
sessions:
symfony2:
symfony2: ~
The solution
You must set the autoload
parameter to behat:
# /behat.yml
default:
autoload:
'': %paths.base%/src