Skip to content

Commit 8636996

Browse files
authored
re-refresh database if transaction has been committed (#53997)
1 parent f826d0f commit 8636996

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Illuminate/Foundation/Testing/RefreshDatabase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public function beginDatabaseTransaction()
108108
$dispatcher = $connection->getEventDispatcher();
109109

110110
$connection->unsetEventDispatcher();
111+
112+
if (! $connection->getPdo()->inTransaction()) {
113+
RefreshDatabaseState::$migrated = false;
114+
}
115+
111116
$connection->rollBack();
112117
$connection->setEventDispatcher($dispatcher);
113118
$connection->disconnect();

0 commit comments

Comments
 (0)