MDL-41256 course tests: improve robustness

* Fail if an exception isn't recieved
* Don't allow the possibility of an undefined variable being tested
MDL-41556 - workshop: undefined constant FILE_INTERNAL message fixed.
MDL-41517 Do not call fix_course_sortorder unnecessarily

Thanks to Thomas Worthington
Merge branch 'wip-MDL-41179-master' of git://github.com/marinaglancy/moodle
MDL-41508 Changes in indentation
Merge branch 'MDL-41428-master' of git://github.com/FMCorz/moodle
Merge branch 'w36_MDL-41255_m26_changepw' of https://github.com/skodak/moodle
MDL-41558 cache: Improve performance of cache::make() by using isset instead of array_key_exist()
MDL-41558 cache: Identifiers should never be passed as null to cache::make()
MDL-23335 mod_forum: allow multi-lang filtering of shortened messages
MDL-41228 phpunit: Reset message processors list in unit tests
Merge branch 'MDL-41440_master' of https://github.com/markn86/moodle
Merge branch 'MDL-32690_restoreMissingAssignment_master' of https://github.com/moodlerooms/moodle
Merge branch 'm26_MDL-29218_plugin_init_not_blocking_when_false' of https://github.com/scara/moodle
Merge branch 'MDL-33472-master' of git://github.com/danpoltawski/moodle
Merge branch 'MDL-37564' of https://github.com/nebgor/moodle
MDL-41413 Events: replaced role_assigned event handler with observer
MDL-41413 Events: replaced role_unassigned event handler with observer
MDL-41413 Events: replaced course_deleted event handler with observer
MDL-23044 Use Files API functions in filesystem cron