Skip to content

Commit

Permalink
Disconnect from the database when refresh is done (#22569)
Browse files Browse the repository at this point in the history
  • Loading branch information
nesk authored and taylorotwell committed Dec 29, 2017
1 parent cfa2e86 commit d1fc278
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Foundation/Testing/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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 d1fc278

Please sign in to comment.