mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
♻️ N°4325 refactor CMDBSource mysqli attributes to a separate wrapper class (#237)
In 2.7.5 with N°3513 we added a second mysqli attribute in CMDBSource, so that we can test transactions (see TransactionsTest). But this wasn't documented, and was really causing confusion ! This refactor wraps both attributes in a dedicated object so that the logic is clearer.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
namespace Combodo\iTop\Test\UnitTest\Core;
|
||||
|
||||
use CMDBSource;
|
||||
use Combodo\iTop\Core\DbConnectionWrapper;
|
||||
use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
use Exception;
|
||||
use MetaModel;
|
||||
@@ -48,7 +49,7 @@ class TransactionsTest extends ItopTestCase
|
||||
}
|
||||
));
|
||||
|
||||
$this->InvokeNonPublicStaticMethod('CMDBSource', 'SetMySQLiForQuery', [$oMockMysqli]);
|
||||
DbConnectionWrapper::SetDbConnectionMockForQuery($oMockMysqli);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user