Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting symfony env per-suite #131

Open
ciaranmcnulty opened this issue Nov 14, 2017 · 5 comments
Open

Allow setting symfony env per-suite #131

ciaranmcnulty opened this issue Nov 14, 2017 · 5 comments

Comments

@ciaranmcnulty
Copy link
Contributor

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

@jon-acker
Copy link

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.

@sroze
Copy link
Contributor

sroze commented Nov 15, 2017

Yep, agree with this as well 👍 😉

@OskarStark
Copy link

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?

@ciaranmcnulty
Copy link
Contributor Author

@OskarStark No idea with dotenv

@jdeniau
Copy link

jdeniau commented Jan 22, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants