Skip to content

Commit

Permalink
Add a fix for transactional database test
Browse files Browse the repository at this point in the history
  • Loading branch information
vokomarov committed Apr 19, 2023
1 parent c4a80ab commit 1f32531
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ protected function scopedDatabase(): void
/** @var \Cycle\Database\DatabaseInterface $db */
$db = $this->getContainer()->get(DatabaseInterface::class);
$db->begin();

$this->getContainer()->get(FinalizerInterface::class)->addFinalizer(static function () use ($db) {
/** @var \Cycle\Database\DatabaseInterface $db */
$db = $this->getContainer()->get(DatabaseInterface::class);

while ($db->getDriver()->getTransactionLevel() !== 0) {
if (! $db->rollback()) {
return;
}
}
});
}

protected function scopedDatabaseFinalise(): void
Expand All @@ -89,7 +78,7 @@ protected function scopedDatabaseFinalise(): void

protected function tearDown(): void
{
// $this->scopedDatabaseFinalise();
$this->scopedDatabaseFinalise();

parent::tearDown();

Expand Down

0 comments on commit 1f32531

Please sign in to comment.