In my phpunit, I have this configuration:
<php>
<env name="ENVIRONMENT" value="test"/>
</php>
I worked under the false assumption that he always set the environment variable to a value test. However, when the system already has a set of variables, it prefers an existing value.
$ export ENVIRONMENT=GNARF
$ phpunit -c test/phpunit.xml
Thus, inside the tests, the value env('ENVIRONMENT')will be "GNARF", although I expected "test".
Is there a way to force phpunit to view the parameter envnot as a default value, but as a specific value that it should use?
I would also like to avoid calling phpunit in a specific way to get the correct env variables.
So while this works:
ENVIRONMENT="test";./vendor/bin/phpunit -c tests/phpunit.xml
phpunit.xml, .