The Zohar reveals that Pharaoh changed the details of his dreams to test Joseph but Joseph corrected Pharaoh and told him the dream as Pharaoh dreamt it. If someone mix or add words to a proper sentence, we know how to put it back together for proper understanding. Joseph knew the spiritual language of the dreams and could tell that Pharaoh was testing him.
“וַיֹּאמֶר פַּרְעֹה אֶל-יוֹסֵף, אַחֲרֵי הוֹדִיעַ אֱלֹהִים אוֹתְךָ אֶת-כָּל-זֹאת, אֵין-נָבוֹן וְחָכָם, כָּמוֹךָ”
“So Pharaoh said to Joseph, “Since God has informed you of all this, there is no one so discerning and wise as you are.”
With this words Pharaoh realizes that God is with Joseph telling him the details of the dream and its interpretation as if he was there.
Rabbi Yitzhak explains that this story tells that Joseph told the dream and its interpretation but in actual, Joseph saw everything from Pharaoh’s words. Pharaoh described the dreams using dream language of a certain level that Joseph knew and could see when Pharaoh was not describing the dream properly.
The Zohar compares Pharaoh’s dream to another famous dream and interpretation from Daniel 3:31-4:34. In the later one, King Nebuchadnezzar had a dream and looked for interpretation. The dream was not described until Daniel came and told the dream and its interpretation.