Testing Laravel: RefreashDatabase not refresing the database!

TL;DR Model::truncate()will cause a Implicit Commit making you falling when using mysql and RefreshDatabase trait.Use Model::query()->delete()instead. Why is the RefreshDatabase trait not refreshing the databse? I was testing my Laravel app using a docker-compose with php + mysql.Was really confused why some of my test are failing when running the whole suite, but works fine …

Testing Laravel: RefreashDatabase not refresing the database! Weiterlesen »