N°3002 Get developer_mode.enabled config param first normally, and if not set from disk

This commit is contained in:
Pierre Goiffon
2021-09-21 13:56:15 +02:00
parent 2f6ed8f8af
commit ae2072f4d5
2 changed files with 35 additions and 17 deletions

View File

@@ -16,9 +16,7 @@
namespace Combodo\iTop\Test\UnitTest\Core\Log;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use DeprecatedCallsLog;
use ExceptionLog;
use LogAPI;
use MetaModel;
@@ -32,18 +30,10 @@ class ExceptionLogTest extends ItopDataTestCase
parent::setUp();
// We are using PHPUnit\Framework\MockObject\Generator::generateMock that is throwing notice !
// Changing the log config so that those won't be caught by \DeprecatedCallsLog::DeprecatedNoticesErrorHandler
// Changing config so that those won't be caught by \DeprecatedCallsLog::DeprecatedNoticesErrorHandler
// disabling devenv is easier than changing log config O:)
$oConfig = MetaModel::GetConfig();
$mLogLevelMin = $oConfig->Get('log_level_min');
if (is_string($mLogLevelMin)) {
$aLogLevelMin[''] = $mLogLevelMin;
} else if (is_array($mLogLevelMin)) {
$aLogLevelMin = $mLogLevelMin;
} else {
$aLogLevelMin = [];
}
$aLogLevelMin[DeprecatedCallsLog::ENUM_CHANNEL_PHP_LIBMETHOD] = LogAPI::LEVEL_ERROR;
$oConfig->Set('log_level_min', $aLogLevelMin);
$oConfig->Set('developer_mode.enabled', false);
}
/**