Adding unit tests

resolves https://github.com/owncloud/apps/issues/1933 some cases are not testable in current architecture (per conversation with icewind)

depends on https://github.com/owncloud/core/pull/11322
I didn't know it was possible to invoke private methods!
Any docs about this technique ?