mercredi 5 juin 2019

Laravel with Docker: wrong DB selected when testing

My docker containers are as such:

  • worklog_laravel_app (Laravel app)
  • worklog_laravel_web (Nginx)
  • worklog_laravel_db (MySQL)

I have two databases setup in the worklog_laravel_db container:

  • worklog
  • worklog_test

Right now, I'm in the midst of writing tests for my app via docker exec -it bash on the worklog_laravel_app container.

I've already setup my env.testing to have the same vars as .env, except with DATABASE set to the worklog_test DB.

But running tests still ends up selecting the local dev DB (worklog) instead.

Why is this so? And how do I resolve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire