Three forms of this exist - when the literal meaning is the opposite of what is intended:
A spoonerism is:
Diagnostic Quiz