Skip to content

Commit

Permalink
re-refresh database if transaction has been committed
Browse files Browse the repository at this point in the history
  • Loading branch information
SjorsO committed Dec 22, 2024
1 parent 620f717 commit f19b479
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Illuminate/Foundation/Testing/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public function beginDatabaseTransaction()
$dispatcher = $connection->getEventDispatcher();

$connection->unsetEventDispatcher();

if (! $connection->getPdo()->inTransaction()) {
RefreshDatabaseState::$migrated = false;
}

$connection->rollBack();
$connection->setEventDispatcher($dispatcher);
$connection->disconnect();
Expand Down

0 comments on commit f19b479

Please sign in to comment.