testing #39533
Replies: 1 comment
-
The solution that I use (recommended solution, totally from personal experience, might differ from other popular answers). Set DB URL in Set DB URL in Set I have used Honestly, I am not sure if this is helpful, so feel free to let me know so that I can try to explain it better next time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
Hope you can help me out with something seemingly trivial.
I'm trying to configure a MySQL test database for my unit tests, because an in-memory SQLite database has proven to be too limited. I was hoping to use an
.env.testing
file for this.Set-up:
.env
containsDB_DATABASE=my_database
.env.testing
is a copy of.env
, but containsDB_DATABASE=my_database_test
Now if I run
php artisan config:clear
andphp artisan config:cache --env=testing
, the resulting config filebootstrap/cache/config.php
containsmy_database
instead ofmy_database_test
. The addition of the--env
argument doesn't seem to matter.What am I missing?
My current hypothesis is that our Docker set-up is somehow responsible for these problems. If I change
DB_DATABASE
in my.env
and rerun the two config commands, the database is not updated until I recreate the container.Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions