The problem here is dat I expect that the config returns a list when I get a key. The code here will create a Mockobject for each item in the list and expects that all the list items are called which gives a problem as I cannot use the list in for example a in_array method. This change should just return a list if that is the value of an key
But that's correct behavior. The Configuration object will never return an array, or a list, unless you specifically call toArray(). Anytime you would try to set an array as a value convert_array_to_class() would turn it into a new instance of a Configuration object.