N°6848 Fix TransactionsTest::testTransactionOpenedNotClosed failing

Was caused by 239c51bb, which adds 65bb76b9 tests improvements but only partly : we were missing in TransactionsTest::tearDown the mysqli reset from mock to original mysqli cnx

Without this reset the rollback made in ItopTestCase::tearDown is throwing an exception (query() method on the DbConnectionWrapper cnx returns false in \CMDBSource::DBQuery) on PHP 8.1 and 8.2

Co-authored-by: Romain Quetiez <romain.queriez@combodo.com>
This commit is contained in:
Pierre Goiffon
2023-10-17 10:48:12 +02:00
parent 239c51bb53
commit d0d90d7c69
2 changed files with 22 additions and 4 deletions

View File

@@ -276,6 +276,7 @@ class TransactionsTest extends ItopTestCase
protected function tearDown(): void
{
try {
DbConnectionWrapper::SetDbConnectionMockForQuery(); // Else will throw error on PHP 8.1+ (see N°6848)
parent::tearDown();
}
catch (MySQLTransactionNotClosedException $e) {