6 He (Jesus) asked this only to test him, for he already had in mind what he was going to do.
I think this cometary is very interesting. Here the writer, John, places a bit of personal observation into his depiction of what was shaping up to be the largest scale miracle Jesus had performed thus far in his ministry. The observation being that John could tell that Jesus was asking a chase-the-rabbit type of question to his disciple Philip. The author knew that Jesus had a plan, that Jesus was in control, that from by the looks of Jesus he was in no way nervous about the reality of feeding 5,000 grown men with no food. So obviously John knew something was about to happen, he had an understanding for the present that Philip was still unable to grasp. That is cool, it sheds light unto the understanding that we are not all going to have an equal understanding of Jesus, we are not all going to have the same level of faith at all times, we all have a different role for the the kingdom, we are unique.
The real reason I think this passage is interesting though is the fact that Jesus intentionally questioned the disciple he knew would chase the question the hardest. Jesus had complete control of the situation, Philips suggestion as to handle the food dilemma held no weight but the reality is that if Jesus would not have asked Philip to weigh in on the circumstances with his own thoughts first, Philip may have completely missed the teaching point because he had no vested interest in the 'how'.
The thing that we don't see is Philip getting upset and stomping off because Jesus asked him a question. He doesn't throw his hands up in disgust because he is being challenged by authority, he doesn't make a scene, and Philip certainly doesn't try to feed the 5,000 on his own out of spite because he is being pressured. No, he answers. He answers honestly. He answers wrong. Then he sits back and watches (probably in amazement) as Jesus works a miracle, then he reaps the benefits with 12 baskets of leftovers.
Philip was respectful and stayed around for the party, he didn't get mad when Jesus challenged him, questioned him, and put him on the spot.
Philip made the right choice.