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().

Fixes https://github.com/owncloud/core/issues/11854