test: disconnect database after each test

This commit is contained in:
Pig Fang 2018-03-11 11:20:21 +08:00
parent 18c0755aa2
commit f3220ee526

View File

@ -42,4 +42,12 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
}
return $this->withSession(['uid' => $role->uid, 'token' => $role->getToken()]);
}
protected function tearDown()
{
$this->beforeApplicationDestroyed(function () {
DB::disconnect();
});
parent::tearDown();
}
}