public function _after(\Codeception\TestCase $test)
{
if ($this->app['db'] && $this->config['cleanup']) {
$this->app['db']->rollback();
}
if ($this->app['auth']) {
$this->app['auth']->logout();
}
if ($this->app['cache']) {
$this->app['cache']->flush();
}
if ($this->app['session']) {
$this->app['session']->flush();
}
// disconnect from DB to prevent "Too many connections" issue
if ($this->app['db']) {
$this->app['db']->disconnect();
}
}