Skip to content

Commit

Permalink
fix afterCommit() and DatabaseTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ejunker authored May 24, 2022
1 parent 2195900 commit 6270367
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Foundation/Testing/DatabaseTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public function beginDatabaseTransaction()
$connection->unsetEventDispatcher();
$connection->beginTransaction();
$connection->setEventDispatcher($dispatcher);

if ($this->app->resolved('db.transactions')) {
$this->app->make('db.transactions')->callbacksShouldIgnore(
$this->app->make('db.transactions')->getTransactions()->first()
);
}
}

$this->beforeApplicationDestroyed(function () use ($database) {
Expand Down

0 comments on commit 6270367

Please sign in to comment.