Skip to content

Commit

Permalink
Revert "Disconnecting the database connection after testing (#49327)" (
Browse files Browse the repository at this point in the history
…#49361)

This reverts commit 2f65457.
  • Loading branch information
driesvints authored Dec 13, 2023
1 parent f6777af commit c13d4c8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Testing/DatabaseTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function beginDatabaseTransaction()
$connection->unsetEventDispatcher();
$connection->rollBack();
$connection->setEventDispatcher($dispatcher);
$database->purge($name);
$connection->disconnect();
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Testing/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function beginDatabaseTransaction()
$connection->unsetEventDispatcher();
$connection->rollBack();
$connection->setEventDispatcher($dispatcher);
$database->purge($name);
$connection->disconnect();
}
});
}
Expand Down
6 changes: 0 additions & 6 deletions src/Illuminate/Foundation/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ protected function tearDown(): void

ParallelTesting::callTearDownTestCaseCallbacks($this);

$database = $this->app['db'] ?? null;

foreach (array_keys($database?->getConnections() ?? []) as $name) {
$database->purge($name);
}

$this->app->flush();

$this->app = null;
Expand Down

0 comments on commit c13d4c8

Please sign in to comment.