diff --git a/core/DbConnectionWrapper.php b/core/DbConnectionWrapper.php index 6f352bc2e..5de337513 100644 --- a/core/DbConnectionWrapper.php +++ b/core/DbConnectionWrapper.php @@ -56,21 +56,12 @@ class DbConnectionWrapper } /** - * mysqli object is really hard to mock as it contains lots of attributes & methods ! Thought we need to mock it to test transactions ! + * Use this to register a mock that will handle {@see mysqli::query()} * - * To solve this, a new attribute exists and is only used in specific use cases, so there are just few things to mock. - * - * This object adds more readability than previous model with 2 attributes in {@see CMDBSource}. - * - * @used-by \CMDBSource - * - * @since 3.0.0 N°4325 Object creation - * This wrapper handles the 2 {@mysqli myqsli} attributes that were previously in {@see CMDBSource} - * To allow testing we added a second mysqli object (N°3513 in 2.7.5) and code became a bit confusing :/ - * With this wrapper everything is in the same place, and we can express the intention more clearly ! + * @param \mysqli|null $oMysqli + * @since 3.0.4 3.1.1 3.2.0 Param $oMysqli becomes nullable * @since 3.1.0-4 N°6848 backport of restoring cnx on null parameter value */ - public static function SetDbConnectionMockForQuery(?mysqli $oMysqli = null): void { if (is_null($oMysqli)) {