* change user name for when password policy is active
* admin user doesn't exist on Jenkins : create a second user
* test UserRights::Login return value
* document that we depend on the sample data
Doing a code review with Bruno, we agreed to do some little refactoring :
* Level per exception class
- Before the whole ExceptionLog::Log method was a total rewrite of its parent, with some code duplicates... not a good idea : we should better improve LogAPI to make other similar uses possible in the future !
- The logic to get level from config must be in a GetMinLogLevel override
* Write to DB
- Pull up this functionnality in LogAPI
- Add a sCode parameter in GetLevelDefault
Doing this refactoring, I also improved :
* Test the attributes set when creating the EventIssue object : during my dev I had crashes because I didn't filled all the mandatory fields... Having a PHPUnit test checking this will prevent future bugs to happen if attributes are modified in the class or in the object creation method
* Use Throwable instead of Exception : this was added in PHP 7.0 and will allow to catch both Exception and Error
* Because we need to have 2 statements on the same line in \Combodo\iTop\Test\UnitTest\Core\Log\ExceptionLogTest::testLogInFile, I modified the editorConfig file to allow disabling the formatter using comments.
Done now before their as used too widely. We are most likely to allow dev. to use custom colors soon, so we want to avoid confusing / renaming then. (iTop extensions have been verified, none had to be migrated)
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.
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.
plus:
- the exception object is no more automatically added to the error.log context (it's way too verbose)
- code cleanup (use constant instead of repeated strings)
- ExceptionLog main method is now named `LogException` instead of `FromException`