Why should we not listen to the Navi who substantiates his prophecy with a miracle?
Ramban: Because as we saw firsthand at Yetzi'as Mitzrayim that Hashem is Master of the world, 1 and that there is no other god like Him; and at Ma'amad Har Sinai, He commanded us 2 not to worship any deity other than Him. 3
Seforno: Because, since his intention is to take you away from Hashem, you should not even examine whether there is any truth in his claim to prophecy or to his having had a dream, as they are certainly false. 4
What is the point of the test, seeing as Hashem knows what is in a person's heart anyway?
Seforno: When you consider the person who speaks against Hashem as an enemy you will have passed the test and proves that you love Him (Hashem) - which, when put into practice, sparks off a reciprocal reaction from Hashem, who showers the world with goodness.
Ramban: In fact, Hashem's tests are based on His love of the Tzadik He is testing.