I'm not getting this test case, the layer property is an instance of OpenLayers.Layer.Vector.RootContainer which never has a length property