MDL-37410 External PHPunit test: used ->getDataGenerator()->enrol_user instead to manually enrol the user. + improve the unassignUserCapability to remove a capability assigned by getDataGenerator->enrol_users