#Anyone else using Herd and running tests?

3 messages · Page 1 of 1 (latest)

hard flare
#

How do I setup my Laravel application to run tests not in my Herd database, but in a separate one. Everything was going great until I migrated my application to Herd locally. Once I ran my tests it wiped out my local database. PHPUnit.xml is already set to testing environment with a different database, but everytime I run my tests it wipes out the local db in Herd instead of using the test DB I configured. Not sure how to change this. Thanks!

hard flare
#

I figured out my own issue. I had cached the local environment. Running php artisan optimize:clear took care of the issue.

still gate
#

Was about to suggest that. You can add a check in the base TestCase that aborts if the database connection isn't the one you expect.