Deuteronomy 18:21-22 NIV

21 You may say to yourselves, "How can we know when a message has not been spoken by the LORD?"
22 If what a prophet proclaims in the name of the LORD does not take place or come true,1 that is a message the LORD has not spoken.2 That prophet has spoken presumptuously.3 Do not be afraid of him.

References for Deuteronomy 18:22