runningUnitTests won't be true because Dusk tests are e2e feature tests.
And the environment to be testing I believe you should create your own environment file which you would like dusk to use. Otherwise dusk will use your .env file which means the same database and so on.
https://laravel.com/docs/8.x/dusk#environment-handling
Hi, I am not on dusk but I am facing this issue. I am running unit tests on Laravel 5 and App::runningUnitTests() is returning false during unit tests run. Why is that happening?
What I already tried is that I tried to set the APP_ENV to testing in the base class of unit test but to no avail. What could be the solution here?