-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't get Laravel to change APP_ENV to 'testing' #2218
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi again 👋 we would like to inform you that this issue has been automatically |
@ultrablue I'm Experiencing this with the multi project setup. Do you ever find a resolution? |
@ultrablue typical.. just after I posted the message. Busted the cache manually (deleted files under boostrap\cache) and it works as expected with the correct environment. cd /var/www/app1
vendor/bin/phpunit --colors=always test/Feature/ExampleTest.php |
@byrontuckett Ha, excellent. I think that I ended up waiting a looooooong time (months), updating Laradock and Laravel, and violá, all cleared up! You're solution is probably better (and could very well be what happened behind the scenes with mine). Thanks for following up! |
Info:
Docker version (
$ docker --version
):Docker version 18.09.2, build 6247962
Laradock commit (
$ git rev-parse HEAD
):83a24ef
System info (Mac, PC, Linux):
Windows
System info disto/version:
Windows 10
Issue:
Something is overriding Laravel's APP_ENV setting, which is causing unit tests run against the application database instead of a sqlite in-memory database. I've added the following line to the top of routes/web.php:
dd(App::environment());
When I run my tests, that outputs:
local
Here are some relevant configurations:
<env name="APP_ENV" value="testing"/>
I've tried a number of things, including:
php artisan cache:clear; php artisan config:cache
I'm forced to conclude that something outside of Laravel is setting APP_ENV. However, I've grepped the laradock directory for 'app_env' and found nothing. So, I'm pretty stumped.
Please let me know if I can provide any other information.
Thanks!
Expected behavior:
At this point, I would like to see the bit that dumps the current APP_ENV output 'testing' when I run a test.
Reproduce:
I don't know?
Relevant Code:
The text was updated successfully, but these errors were encountered: