diff --git a/src/Illuminate/Foundation/Testing/DatabaseTransactions.php b/src/Illuminate/Foundation/Testing/DatabaseTransactions.php index c6fb714ada4b..83a686f3558c 100644 --- a/src/Illuminate/Foundation/Testing/DatabaseTransactions.php +++ b/src/Illuminate/Foundation/Testing/DatabaseTransactions.php @@ -33,7 +33,7 @@ public function beginDatabaseTransaction() $connection->unsetEventDispatcher(); $connection->rollBack(); $connection->setEventDispatcher($dispatcher); - $database->purge($name); + $connection->disconnect(); } }); } diff --git a/src/Illuminate/Foundation/Testing/RefreshDatabase.php b/src/Illuminate/Foundation/Testing/RefreshDatabase.php index c68b19bbd54d..0f916ac55b51 100644 --- a/src/Illuminate/Foundation/Testing/RefreshDatabase.php +++ b/src/Illuminate/Foundation/Testing/RefreshDatabase.php @@ -109,7 +109,7 @@ public function beginDatabaseTransaction() $connection->unsetEventDispatcher(); $connection->rollBack(); $connection->setEventDispatcher($dispatcher); - $database->purge($name); + $connection->disconnect(); } }); } diff --git a/src/Illuminate/Foundation/Testing/TestCase.php b/src/Illuminate/Foundation/Testing/TestCase.php index e38e65430a08..a7315a2c5124 100644 --- a/src/Illuminate/Foundation/Testing/TestCase.php +++ b/src/Illuminate/Foundation/Testing/TestCase.php @@ -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;