Skip to content

Commit

Permalink
Ignore SQL transaction commands that happen in some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Aug 6, 2023
1 parent 70a969b commit 6dcf304
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH10880Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,22 @@ public function testProcessShouldBeUpdated(): void
$queryLog->reset()->enable();
$this->_em->flush();

$this->removeTransactionCommandsFromQueryLog();

self::assertCount(1, $queryLog->queries);
self::assertSame('UPDATE GH10880BaseProcess SET description = ? WHERE id = ?', $queryLog->queries[0]['sql']);
}

private function removeTransactionCommandsFromQueryLog(): void
{
$log = $this->getQueryLog();

foreach ($log->queries as $key => $entry) {
if ($entry['sql'] === '"START TRANSACTION"' || $entry['sql'] === '"COMMIT"') {
unset($log->queries[$key]);
}
}
}
}

/**
Expand Down

0 comments on commit 6dcf304

Please sign in to comment.