Using environment variables in Laravel tests →

Matt Stauffer has a new quick tutorial on how to implement an .env.test file for your unit tests.

He starts out discussing ways of setting them through the phpunit.xml file but those would then be committed to the repo which isn’t ideal. With help he came up with the idea to utilize DotEnv and include the .env file from tests/TestCase.php.

Go read the full tutorial for all the details.

Source: Using environment variables in Laravel tests →


Related Posts

Published by

Informer

Informer

Just another HTMLy user.