-
-
Notifications
You must be signed in to change notification settings - Fork 196
Description
Hi guys!
I noticed that the EnvConfiguration
adds environment variables to .env.dist
and also phpunit.xml.dist
. This is because phpunit does not read .env
. Instead, you should define all of your environment variables in phpunit.xml.dist (or set real env variables).
I think this is confusing (I just got bit by it). It means that my environment variables now need to be duplicated in the .env
files and also phpunit.xml.dist
. It also makes it difficult to run commands in the test environment, as using --env=test
isn't enough: the incorrect environment variables will be used (those from .env
instead of phpunit.xml.dist
). I also didn't know to look in phpunit.xml.dist
: I was looking in .env
and the app wasn't seeing my changes.
Obviously, this was done intentionally. But, are we sure about this behavior? I would prefer consistency with console
and index.php
: that .env
is read (assuming there is no APP_ENV
) and then any environment variables in phpunit.xml.dist
override those (admittedly, I'm not exactly sure how to accomplish this).
Cheers!