Buddha's night before enlightenment
In my understanding, Buddha did not progress through the four stages of enlightenment he later prescribed for his students.

This is because, for Buddha students - you start with theoretical understanding (stream entry), and then you practice according to instructions until you achieve it (arahant-hood).

In Buddha's case, because he is Self-Awakened, he starts with intuitive practice and then achieves understanding (Bodhi). 

So in Buddha's case he does not proceed gradually, phase by phase, like assembling the puzzle by looking at the complete picture. Instead, it's like solving a puzzle randomly - by the time he sat under the Bodhi Tree, he had assembled most of the pieces but still did not know what was shown on the picture.

This is why in Buddha's case he left all interpretative possibilities open until the last moment, which means he still had doubts until the very last moment. Those doubts are represented in the anthropomorphic personification known as "the Mara".

In case of Buddha's students, the interpretative framework is locked in place from the time of stream-entry, so doubts are eliminated at that phase.