I personal set the env variables for testing in my phpunit.xml.dist (or phpunit.xml) file. See: https://phpunit.readthedocs.io/en/9.5/configuration.html#the-env-element
<phpunit>
<!-- other config -->
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_DEBUG" value="false"/>
<env name="ACTIVITY_LOGGER_ENABLED" value="false"/>
<!-- other settings-->
</php>
</phpunit>
If you really want to use the .env.testing you should extend the base Laravel TestCase that boots the framework for you.
mazedlx liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community