FriendsOfBehat / SymfonyExtension

:musical_score: Extension integrating Behat with Symfony.
MIT License
473 stars 61 forks source link

`kernel.environment`config: mistmatch between documentation and implementation #215

Open tucksaun opened 2 months ago

tucksaun commented 2 months ago

The current documentation states:

It allows you to force using a given environment. If it is not set, it uses APP_ENV environment variable if defined or falls back to test.

However, the current code does not implement this: https://github.com/FriendsOfBehat/SymfonyExtension/blob/dfb1c9c96cc0fb7c8e1caa060695426a12e1efbd/src/ServiceContainer/SymfonyExtension.php#L185-L191

The actual behavior of the code is to setup only if APP_ENV is not already defined (so not to force it) and the configuration value fallbacks to test (see https://github.com/FriendsOfBehat/SymfonyExtension/blob/dfb1c9c96cc0fb7c8e1caa060695426a12e1efbd/src/ServiceContainer/SymfonyExtension.php#L74).

I'm willing to submit a PR to fix this issue but wanted to know which way the maintainers want to move: fix the documentation that is misleading or fix the behavior in order to match the documentation?

walva commented 1 week ago

Hello @tucksaun,

I feel a bit guilty… I wrote this part of the documentation.

I lost a couple of hours because I wasn't aware of this option, so I wanted to inform. I cannot say which option is the best, but willing to help if I can.

tucksaun commented 1 week ago

Hey @walva 👋

Please don't: TBH intuitively a colleague and I though this would be the behaviour 🙂 Thank you for the help proposition, will keep in mind. But we need some guidance to know which way to go. As you are a contributor, do you know someone we can ping maybe?