Added UnitTest for bug#4040.
Merge branch 'master' of git.otrs.com:otrs/otrs