Skip to content

Commit 51cdabf

Browse files
authored
fix afterCommit() and DatabaseTransactions (#42502)
1 parent 7fea108 commit 51cdabf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Illuminate/Foundation/Testing/DatabaseTransactions.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public function beginDatabaseTransaction()
2020
$connection->unsetEventDispatcher();
2121
$connection->beginTransaction();
2222
$connection->setEventDispatcher($dispatcher);
23+
24+
if ($this->app->resolved('db.transactions')) {
25+
$this->app->make('db.transactions')->callbacksShouldIgnore(
26+
$this->app->make('db.transactions')->getTransactions()->first()
27+
);
28+
}
2329
}
2430

2531
$this->beforeApplicationDestroyed(function () use ($database) {

0 commit comments

Comments
 (0)