How did you tell your unit tests to use your testing connection? Also, have you defined protected $connection = 'mysql'; on your models?
Dec 22, 2017
2
Level 1
DB Not Persisting Through UnitTests
My testing, in memory, sqlite database is not persisting through model calls... The code is the following...
public function setUp()
{
parent::setUp();
dd(DB::connection()->getName(), User::all()->first()->getConnectionName());
}
and the result is ...
testing
mysql
Why is the database being reset through the model calls
Please or to participate in this conversation.