Properly register sharing hooks and proxies

This will fix failing tests when shares weren't cleant up on delete due
to missing hooks.

Added login for user1 in setUp().
Merge pull request #11865 from owncloud/stable7-fix-enc-sharingtests

Properly register sharing hooks and proxies