Relative Content

Tag Archive for laravelphpunitlaravel-migrationspest

Laravel Testing with Multiple Databases: Preventing Migrations During Tests / Migrations failing

I’m working on a Laravel project that uses multiple MySQL databases. The main database (core_db) contains system tables like users, migrations, etc., while express_db and regio_db contain most of the other application tables. For testing, I’m using phpunit and pest, and I want to ensure that the tests run efficiently without unnecessary migrations. Even tho all migrations are already ran, Laravel is rerunning the migrations, and then its failing, because the main dbs are already up2date but Laravel is not recognizing it.