ceiling fan/light fixture wiring with 3 (3-wire) cables
Whites all together with a switch loop, that's not good.  It means you are switching neutral.  Power is going 


from the 2 black wires (supply and onward) to the fan's hot...
from the fan's neutral  to the switch via the black wire
and then from the switch to the neutral bundle via the white wire. 


That is bas-ackwards and was wired by an amateur.  

First, the switch loop cable must be identified and both ends of the white wire marked with black tape, per Code.  Also, this white must be used as always-hot, per Code.  This is why: electricians are expected to test wires, and by making white always-hot, it will clearly test as hot every time.  Otherwise if the switch is off, it will test as not hot, and could be mistaken for the usual hot-neutral pair. There was once a rule that white wires didn't need to be marked if the usage was obvious, but you just saw how it isn't obvious even in a simple situation.

I for one am a big fan of marking switched-hot wires with red tape, so I'd mark both ends of the switch-loop black with red tape, while I was in there. Also the black wire on the lamp itself.  

Switch-loop black and lamp black (the ones I'd mark red) go together. 

The remaining blacks are supply and onward power. They go together with the switch-loop always-hot (white tagged black).  The remaining wires are all white, they go together.