MDL-43440 unit testing: Use cmid in unit tests when it should be used.

instance is has been used instead of cmid.  This works as all id's are 1
in most cases, but not always.

accesslib_clear_all_caches_for_unit_testing was updated to clear the
$USER->access cache which would fail test when the wrong user's data was used.

Conflicts from extra tests in master:
	blocks/comments/tests/events_test.php
	mod/assign/submission/comments/tests/events_test.php
	mod/data/tests/lib_test.php
	mod/glossary/tests/events_test.php
MDL-43593 Assign editpdf: More robust handling of errors from TCPDF.

This includes a check to see if there are 0 pages in the combined pdf,
catching exceptions and suppressing php warnings and errors from bad pdf files.

Also - Use TCPDF directly to check if pdfs are compatible. The previous check was
letting dodgy PDFs through which then failed at generation time. This way dodgy
pdfs will get run through ghostscript early and cleaned up.
MDL-39942: invite only users who can post to discuss
MDL-43884 database: Fix get_tables() api for external stores
MDL-43892 dbtransfer: Fix missing string.
MDL-43805 assign: Quickgrading wipes out grades for hidden columns.

Grr.. quickgrading will always be a hack.
MDL-43805 assign: Behat test for quickgrading bug
MDL-37714: Correctly identify frequently used comments during restore
MDL-43905 fix update of user login times

There needs to be only one event during user login.
The timemodified field is not supposed to be updated during login.
MDL-33920 filepicker: hide 'save as' field when not applicable
MDL-43828 forum: allow to select single available group when posting
MDL-43926 Unit tests shouldn't assume only one category on install
MDL-43936 questions: document renderer API change.
MDL-41647 WebServices: Changed notification CSS class
Merge branch 'MDL-43440-26' of git://github.com/mr-russ/moodle into MOODLE_26_STABLE
MDL-43951 behat: Fixing random failure

NodeElement->hasAttribute() (JS enabled) queries selenium
about whether it has any attribute or not, if due to an
AJAX request the field node changed selenium can not access
that node and throws an exception.
Merge branch 'MDL-43951_26' of git://github.com/dmonllao/moodle into MOODLE_26_STABLE
Merge branch 'MDL-43593-26' of git://github.com/damyon/moodle into MOODLE_26_STABLE
Merge branch 'w05_MDL-43905_m26_loginevents' of git://github.com/skodak/moodle into MOODLE_26_STABLE
Merge branch 'MDL-43805-26' of git://github.com/damyon/moodle into MOODLE_26_STABLE