mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
N°4261 - implement feedbacks from the team
plus: - the entrypoint is now `LogException()` instead of `FromException()` which sounded more like a factory and less like an active method. - merge conflicting commit with @molkobain (CC fix) - remove the writing of the exception object in the error.log context (adding it was an error, it's way too verbose!!). - Technical note: The context is still used to propagate the exception across several call stack, so it now uses a less generic naming in order to avoid conflicts (see `ExceptionLog::CONTEXT_EXCEPTION`). another solution would have been to add a new parameter to `ExceptionLog::Log()`, but I didn't want to add constraint over the hypothetical evolution of the base class method.
This commit is contained in:
@@ -70,7 +70,7 @@ class ExceptionLogTest extends ItopDataTestCase
|
||||
$oException = new $aExceptions[$i]("Iteration number $i");
|
||||
$iExpectedWriteNumber = $aExpectedWriteNumber[$i];
|
||||
$iExpectedDbWriteNumber = $aExpectedDbWriteNumber[$i];
|
||||
$aExpectedFileContext = array_merge($aContext, ['__exception class' => get_class($oException)]); //The context is preserved, and, if the key '__exception' is not yet in the array, it is added
|
||||
$aExpectedFileContext = array_merge($aContext, ['exception class' => get_class($oException)]); //The context is preserved, and, if the key 'exception class' is not yet in the array, it is added
|
||||
$mockFileLog->expects($this->exactly($iExpectedWriteNumber))
|
||||
->method($sLevel)
|
||||
->with($oException->GetMessage(), $sChannel, $aExpectedFileContext)
|
||||
|
||||
Reference in New Issue
Block a user