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 #11863 from owncloud/fix-enc-sharingtests

Properly register sharing hooks and proxies