DatabaseTransactions
trait allows databases to rollback all the change during the tests. If you want to rollback multiple databases , you need to set $connectionsToTransact
properties
use Illuminate\Foundation\Testing\DatabaseMigrations;
class ExampleTest extends TestCase
{
use DatabaseTransactions;
$connectionsToTransact =["mysql","sqlite"] //tell Laravel which database need to rollBack
public function testExampleIndex()
{
$this->visit('/action/parameter')
->see('items');
}
}