Skip to content

Commit

Permalink
Fix "Too Many Connections" error during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemfp authored Jan 16, 2018
1 parent a722705 commit 17d8733
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Testing/DatabaseTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public function beginDatabaseTransaction()

$this->beforeApplicationDestroyed(function () use ($database) {
foreach ($this->connectionsToTransact() as $name) {
$database->connection($name)->rollBack();
$connection = $database->connection($name);

$connection->rollBack();
$connection->disconnect();
}
});
}
Expand Down

0 comments on commit 17d8733

Please sign in to comment.