Add test for looping over a collection of objects.

This is exactly what doctrine does, so this should work.