MDL-31181 fix missing global $CFG that was breaking unit test teardown