Skip to content

Commit c13d4c8

Browse files
authored
Revert "Disconnecting the database connection after testing (#49327)" (#49361)
This reverts commit 2f65457.
1 parent f6777af commit c13d4c8

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

src/Illuminate/Foundation/Testing/DatabaseTransactions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function beginDatabaseTransaction()
3333
$connection->unsetEventDispatcher();
3434
$connection->rollBack();
3535
$connection->setEventDispatcher($dispatcher);
36-
$database->purge($name);
36+
$connection->disconnect();
3737
}
3838
});
3939
}

src/Illuminate/Foundation/Testing/RefreshDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function beginDatabaseTransaction()
109109
$connection->unsetEventDispatcher();
110110
$connection->rollBack();
111111
$connection->setEventDispatcher($dispatcher);
112-
$database->purge($name);
112+
$connection->disconnect();
113113
}
114114
});
115115
}

src/Illuminate/Foundation/Testing/TestCase.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,6 @@ protected function tearDown(): void
197197

198198
ParallelTesting::callTearDownTestCaseCallbacks($this);
199199

200-
$database = $this->app['db'] ?? null;
201-
202-
foreach (array_keys($database?->getConnections() ?? []) as $name) {
203-
$database->purge($name);
204-
}
205-
206200
$this->app->flush();
207201

208202
$this->app = null;

0 commit comments

Comments
 (0)