I have a .env
file containing my database connection details, as is normal for Laravel 5. I want to override these for testing, which I can do in phpunit.
This is 2019.
I had this issues for so long until I was able to figure it out.
And here is my assumption:
If you are also finding it difficult to make your PHPUnit.xml talk with your .env.testing file, then you are likely using PHPStorm!
If this is true, continue reading.
If not, nope...this won't help.
Ok...
Here you go:
What this does is to make all your changes in the xml file take effect. So, go ahead, create the .env.testing file, create your preferred DB config variables for test...and try running your tests again!