Symfony2Extension
Symfony2Extension copied to clipboard
Allow setting symfony env per-suite
Currently I'm using a 2-layer approach:
- Injecting symfony services to the context with fake infrastructure
- Doing end-to-end tests with symfony driver and real infrastructure
It's currently not possible (I think) to arrange these in suites because the symfony env is set at the extension level.
It'd be great to be able to set this at the suite level instead / as well
I second this, as I had similar problem, and resorted to using different profiles rather than suites as they allow setting kernel env. having this option at the suite level would make sense.
Yep, agree with this as well 👍 😉
any news on this?
How are you running your behat tests with APP_ENV=test
? Is it possible somehow (without copying the index.php
to index_test.php
?
@OskarStark No idea with dotenv
@OskarStark @ciaranmcnulty I made it work using this configuration for Symfony2Extension:
default:
extensions:
Behat\Symfony2Extension:
kernel:
bootstrap: 'config/bootstrap.php' # used to load the dotenv configuration in replacement of app/autoload.php
env: 'test' # does not seems to work as everything is manager by APP_ENV now
debug: 'true'
path: 'src/Kernel.php' # previously was AppKernel.php
class: 'App\Kernel' # previously was `AppKernel`
and by running:
APP_ENV=test behat