Fix unit tests so they work in Moodle core.