A mechanic who falsely passed a car on its MOT has been sentenced to community service.