Support the ongoing development of Laravel.io →
posted 2 years ago
Laravel
Last updated 2 years ago.
0
moderator

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

1

Sign in to participate in this thread!

Eventy

Your banner here too?

Cary Lewis carylewis Joined 28 Jan 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.