Why would God need to test Abraham, though? Doesn't He already know everything? One answer I heard to that was "Well, yes He does, but now Abraham knows too." True, but not entirely satisfying.
Let me chase a rabbit a bit.
One of the principles of quantum mechanics is that an object can be in a set of a number of different states simultaneously. An anonymous electron is flying through space. Which direction is it's spin pointing?
Unless you measure it, you don't know. If you haven't measured it, the correct and accurate way to treat it is as though it was a bit of both at the same time. If you don't calculate as though that were the case, the results don't work. When you do the results look great.
The spin isn't pointing forward, or backward, until you measure it. Then you can say "The spin points forward for this electron." It doesn't really do that until you measure it. Before a test, before a measurement, you can say "This is a mix of states X, Y, and Z" After the test you can say "This is state Y." It was a mix of states (potentially only one), now it is only one.
Maybe a test is a way of making something real, and not just potential, in our lives. Potentially, I'd be a steadfast martyr. Potentially, I'd burn a pinch of incense after a few lashes or perhaps merely after being ostracized. A test would make me one or the other. In the meantime, neither is really real.
Please do not construe this as a request for hard testing. I regularly pray to not be lead into that.